FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Calling a php file from another on apache server
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Calling a php file from another on apache server [message #181091 is a reply to message #181077] Thu, 11 April 2013 19:20 Go to previous message
Jordan Thompson is currently offline  Jordan Thompson
Messages: 4
Registered: April 2013
Karma:
Junior Member
Excellent!! I did this:
require($_SERVER['DOCUMENT_ROOT'].'/../db.php');
and everything is behaving correctly.

You are right: there were (several!) db.php files laying around (it wasn't me!)

thanks so much for everyone's help.


On Wednesday, April 10, 2013 3:49:22 PM UTC-4, Jordan Thompson wrote:
> 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!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Error while Generating SiteMap
Next Topic: Calling child class from parent class
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 23:36:11 GMT 2024

Total time taken to generate the page: 0.06319 seconds