I have a php page with
<?php echo $_SERVER['DOCUMENT_ROOT']?>
Then my javascript is
var data = "Not Set";
$.get("test.php",function(returnData,requestStatus,requestObject){
data = returnData;
alert(data);
});
If I navigate directly to the php page on the site, it displays the data that I need. I just can't seem to get the data into my javascript.
Am I on the right track and if so where am I going wrong? Or is there an easier way to get the full filepath when working with a server? Currently if I run document.location.href in my javascript it returns .
http ://127.0.0.1/etc