So I'm trying to load a page with a URL as a GET variable. Unfortunately, I keep getting a 404 from apache. Using JQuery, my syntax for the request is the following:
$.ajax({
type: "GET",
url: "page.php&url="+theURL,
dataType: "xml",
success: function(xml){
loadFeed(xml);
}
});
and the php for page.php is as follows:
<?php
domain="localhost";
header('Content-type: application/xml');
referer=$_SERVER['HTTP_REFERER'];
if(!stripos($referer, $domain)){
print("BAD REQUEST");
return;
}
$handle = fopen($_GET['url'], "r");
if ($handle) {
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
echo $buffer;
}
fclose($handle);
}
?>
Not sure what i'm doing wrong here.