PDA

View Full Version : Help: How to include(and show) a PHP page inside a DIV tag (of another HTML)



Megatron
05-21-2007, 06:24 AM
How do you include a PHP page inside a DIV tag so that the page can be visible inside the block created by the DIV tag.

<div id="middleBOX2"</div>
<a href="http://..../xyz.php">Link</a>
<img src="..." alt="..." />


The above code gives a "link" to the new PHP page.. but can we include the PHP page directly into the html??



It works with frames.. with one frame showing HTML and other showing*.php

thetestingsite
05-22-2007, 12:41 AM
Something like this?



<div id="test">
<?php include('test.php'); ?>
</div>


Assuming test.php was something like this (and not a full HTML page):



<?php

echo 'This is a test';
?>


Hope this helps.

boogyman
05-22-2007, 12:56 PM
Something like this?



<div id="test">
<?php include('test.php'); ?>
</div>


Assuming test.php was something like this (and not a full HTML page):



<?php

echo 'This is a test';
?>


Hope this helps.

That is good if he would like the output of the php, if Mega would like to see the actual code you would need a little bit more work. you would need to replace all of the html special characters with their character entities so that it will not process the php script, but rather print it out