View Full Version : embeding a php file in a php file - how?
lankinator
01-26-2007, 05:07 PM
How do i embed a php page in a page?
jscheuer1
01-26-2007, 05:35 PM
I liked the looks of this tutorial (for getting across the basics quickly):
http://www.tizag.com/phpT/include.php
But, you can take your pick from these:
http://www.google.com/search?hl=en&lr=&client=opera&rls=en&q=PHP+include&btnG=Search
Define "embed." Are you talking about using an iframe?
djr33
01-26-2007, 11:07 PM
include(), though a little more work in some cases, would likely turn out much better.
It does depend on the situation. Anything from iframes to include() to ajax might fit.
lankinator
01-27-2007, 12:59 PM
without using an iframe...
I repeat:
Define "embed.""Embed" can mean:Output as part of the document Store the data from the second file within the first file Link to the second file from the first file in such a way that the first file is affected by the contents of the second
Never quote yourself. It looks conceited.
lankinator
01-27-2007, 01:20 PM
Store the data from the second file within the first file
<?php
$secondFile = <<<EOF
Some data goes here. You can put whatever you like here and it will be stored within the file (in the variable \$secondFile) and not output.
EOF;
?>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.