Portal Home > Knowledgebase > Articles Database > PHP - Printing output to specific spot on html
PHP - Printing output to specific spot on html
Posted by JustinAY, 06-22-2008, 04:48 PM |
Hello!
I am wondering, how do you print output to specific spots on an HTML? I am trying to echo the variable I want printed in the spot I want on the page , however that doesn't appear to work. When I just echo it after using require() on the html page, it either goes to to the top or bottom.
Thanks for any help
|
Posted by 111111z, 06-22-2008, 05:01 PM |
php
$i=2;
echo "The value is $i";
?>
try that
|
Posted by JustinAY, 06-22-2008, 05:06 PM |
Yes. I realize how to echo. However, echoing the variable in the block (in the block of text) isn't working. However when I put this in the php file
$pingresult = shell_exec ("ping -c 3 $desiredhost");
echo (" $pingresult ");
It just echos it at the very bottom.
|
Posted by 111111z, 06-22-2008, 05:22 PM |
Sounds like you may have some output buffering on or something like that.
are you using ob_start somewhere in your code?
|
Posted by JustinAY, 06-22-2008, 05:24 PM |
No, I don't have ob_start anywhere. Should I?
|
Posted by 111111z, 06-22-2008, 05:35 PM |
No ob_start not needed..........see link below
look at http://build1userver.com/pingtest.php
from this code - all in pingtest.php
New Page 1
Pinging will now start |
$pr";?>
|
Pinging will no stop |
Last edited by 111111z; 06-22-2008 at 05:39 PM.
|
Add to Favourites Print this Article
Also Read