Any idea why this won't work? It just dosn't do anything
Code:
<script language='javascript'>
function file_get_contents( url )
{
// http://kevin.vanzonneveld.net
// + original by: Legaev Andrey
// % note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain.
// * example 1: file_get_contents('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm');
// * returns 1: '123'
var req = null;
try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {
try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {
try { req = new XMLHttpRequest(); } catch(e) {}
}
}
if (req == null) throw new Error('XMLHttpRequest not supported');
req.open("GET", url, false);
req.send(null);
return req.responseText;
}
var filecontents;
filecontents=file_get_contents('http://localhost/spacetrade/HTML & Code/blah.php');
document.write(filecontents);
</script>
Bookmarks