Page 1 of 1

php proxy and question mark problem (html, javascript, php)

Posted: Tue Dec 08, 2009 1:01 pm
by nazg
Hi, I am using a proxy which takes a url in a url variable and gets the site content. It works, although there are some kinks to be worked out with using the proxy. However, when I ask the proxy to go to a page whose url contains a question mark it instead goes to the page whose url is only up to the question mark of the url I want.
i.e.
I request the page whose url is http://somedomain.php?var1=stuff&var2=morestuff
by linking to http://mydomain/myproxy.php?http://some ... =morestuff
It instead gets the page http://mydomain/myproxy.php?http://somedomain.php

myproxy.php contains the following:

Code: Select all

<html>
 
<?php
$daurl = $_GET['url'];
echo '<head><base href='.$daurl.'></head><Body>';
 
// Set your return content type 
//header(Content-type: application/xml);
 
// Website url to open
 
// Get that website is content
$handle = fopen($daurl, "r");
 
// If there is something, read and return
if ($handle) {
    while (!feof($handle)) {
        $buffer = fgets($handle, 4096);
        echo $buffer;
    }
    fclose($handle);
}
?>
 
</body>
</html>
Thanks

Re: php proxy and question mark problem (html, javascript, php)

Posted: Tue Dec 08, 2009 1:11 pm
by AbraCadaver
Don't cross post, it's annoying!

viewtopic.php?f=1&t=109977

Re: php proxy and question mark problem (html, javascript, php)

Posted: Tue Dec 08, 2009 1:31 pm
by nazg
sorry. I figure perhaps I was posting in the wrong place.