Solved

PHP Includes

Posted on 2009-04-08
3
368 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

805 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