Solved

PHP Includes

Posted on 2009-04-08
3
384 Views
Last Modified: 2013-12-13
I am just getting started creating an application using PHP/MySQL.  I have built a few before, but would like to streamline my workflow on this one using PHP Includes.  The page that will utilize the includes has <div> tags for CSS layouts, do i need to specify the width/height in the Include file or will it automatically adjust to the inherited file?
0
Comment
Question by:axessJosh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
EMB01 earned 125 total points
ID: 24098896
It will auto-adjust based on that pages CSS.
0
 
LVL 20

Expert Comment

by:DVation191
ID: 24098931
When you include an external page for the purposes of importing content, it renders as if it was on the page already. In other words, if index.php has an include function for navigation.php, the CSS styles declared in index.php would be inherited by the contents of navigation.php, whether you declare width or height attributes or not.

// To include an external file in PHP
<?php include("navigation.php"); ?>

Open in new window

0
 
LVL 14

Expert Comment

by:EMB01
ID: 24098981
Exactly correct. When you use includes, just think of it as combining two pages codes into one code.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question