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

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Locked
nazg
Forum Newbie
Posts: 12
Joined: Thu Dec 03, 2009 11:52 am

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

Post 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
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

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

Post by AbraCadaver »

Don't cross post, it's annoying!

viewtopic.php?f=1&t=109977
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
nazg
Forum Newbie
Posts: 12
Joined: Thu Dec 03, 2009 11:52 am

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

Post by nazg »

sorry. I figure perhaps I was posting in the wrong place.
Locked