Calling a php file from another on apache server [message #181077] |
Wed, 10 April 2013 19:49 |
Jordan Thompson
Messages: 4 Registered: April 2013
Karma:
|
Junior Member |
|
|
Hi there. I am new to php. I want a top-level php file to call another that will generate html. When I access the top-level file, I only get:
"hello from top"
I checked the logs and there are no errors. "Hello.txt" is generated in the htdocs folder, so I know that the lower-level file is executed correctly,
Here is the top-level php file ("top.php") that is located in the htdocs folder:
<?php
session_start();
echo '<!DOCTYPE HTML>';
echo '<html>';
echo 'hello from top';
exec("php hello.php");
echo '</html>';
?>
Here is the lower-level php file ("hello.php") that is also located in the htdocs folder:
<?php
session_start();
echo "hello from bottom";
phpinfo();
touch("hello.txt");
?>
This should be really easy, but I am very confused.
thanks in advance!
|
|
|