mihomes Posted August 15, 2006 Share Posted August 15, 2006 Here is the deal... I just switched all my websites to a new server and they are all on the same IP address whereas before each site had its own IP.I make a call such as <?php include($_SERVER['DOCUMENT_ROOT']."/document.php");?>What I expect from this is it will look at www.example.com/document.php as it always did before. Instead it looks for the 'document.php' file from the first account on the IP.Warning: main(/home/absolute/public_html/document.php): failed to open stream: No such file or directory in /home/network/public_html/index.html on line 1Warning: main(): Failed opening '/home/absolute/public_html/document.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/network/public_html/index.html on line 1So in this case it should look for the file in the account network, but instead looks for it in the account absolute as all the domains are on the same IP now. How in the world can I fix this?I cannot change the code to <?php include($_DOCUMENT_ROOT."document.php");?> as if the call is made in a higher directory then the root it looks in the wrong location. Quote Link to comment Share on other sites More sharing options...
SharkBait Posted August 15, 2006 Share Posted August 15, 2006 I use $_SERVER['PHP_SELF'] when referencing itself.So a file I call guestbook.php in a form I would make it look like[code]<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">[/code]That the type of thing you want to do? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.