Jump to content

get web root


jwk811

Recommended Posts

nevermind it doesnt even work when i put the full url in.

 

its an ajax thing

 

xmlhttp.open("GET","lib/getMessage.php",true);

 

that works for only the front page. but if i go to a different folder it wont work because the url changes.

 

if i put

xmlhttp.open("GET","http://www.domain.com/lib/getMessage.php",true);

that doesnt work tho!

 

why??? i know this is more ajax/js now but please help

Link to comment
https://forums.phpfreaks.com/topic/204776-get-web-root/#findComment-1072084
Share on other sites

Your problem could be that you're accessing the web page without the www. and the AJAX request includes the www In that case you should either force www or no www or do something like this:

 

xmlhttp.open("GET","http://" + location.host + "/lib/getMessage.php",true);

Link to comment
https://forums.phpfreaks.com/topic/204776-get-web-root/#findComment-1072096
Share on other sites

Your problem could be that you're accessing the web page without the www. and the AJAX request includes the www In that case you should either force www or no www or do something like this:

 

xmlhttp.open("GET","http://" + location.host + "/lib/getMessage.php",true);

 

tytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytytyty

Link to comment
https://forums.phpfreaks.com/topic/204776-get-web-root/#findComment-1072116
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.