How can I get the document root from my www folder? I do $_SERVER['DOCUMENT_ROOT'] and it goes back and does E:/wamp/www which I don't want.
Well since that is the document root... what do you want?
well i have this
echo "<img src=\"" . $Server. "includes/bar.php?PC=$pc\"><br>";
Which outputs <img src="E:/wamp/www/includes/bar.php?PC=5"><br>
but not image displays, how can i find the error of this image?
I should say when i call localhost/includes/bar.php?PC=5 it works fine.
If you just want the "web" relative root, you'd just start the path with "/".
but in the root folder it'll be includes/bar.php and in a sub folder it would be ../includes/bar.php
how do i get around that?
NZ_Kiwis wrote:how do i get around that?
One simple way is to always use absolute paths.
I get this error
Warning: require(http://localhost:7477/includes/pollgraph.php) [function.require]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in E:\wamp\www\includes\displaypoll.php on line 27
why does it work on a remote server but not on my home WAMP SERVER being my home pc?