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
Solved

PHP Includes

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

856 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