Solved

PHP Includes

Posted on 2009-04-08
3
351 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
Comment Utility
It will auto-adjust based on that pages CSS.
0
 
LVL 20

Expert Comment

by:DVation191
Comment Utility
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
Comment Utility
Exactly correct. When you use includes, just think of it as combining two pages codes into one code.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now