Forum Moderators: coopster
if i have a code like this
<div>
<?php include("some file")?>
</div>
<p>
hello
</p>
<div>
<?php include("some file 2")?>
</div>
what will happen
the two includes files will be included in the file and the data of file 1 and file 2 will be added to the php file in random?
the data of file 1 will be between the first div then hello then data of div 2?
It will happen in "top down" sequence, or procedural sequence as we often say. So, say you had a global variable defined in "some file" named $myVarFromSomeFile, you could actually refer to that variable in "some file 2" if necessary. It's a terrible example as that is really not an ideal programming practice, but a good example to explain how the included files get loaded and how the scope of your variables would be available.
<div><?php include "some file"; ?></div>
<p>hello</p>
<?php exit; ?>
<div><?php include "some file 2"; ?></div>
A helpful link ... Basic syntax [php.net]
i made this site long ago
i tried using this technique but it didnt work correctly when u open the site and view the source code
u will see a div with class whit
empty
which in reality contains all the data that is below the div
tell me if u need any other info to understand the problem
<body class="whole">
<?php require("top.php");?>
<?php require("pulldown.php");?>
<?php require("home.php"); ?>
</body>
actually this is the index file
and whit is in home.php
[edited by: coopster at 12:34 pm (utc) on Dec. 24, 2008]
[edit reason] no personal urls please TOS [webmasterworld.com] [/edit]