phpSensei Posted November 14, 2007 Share Posted November 14, 2007 http://www.flash-portal.org/fpslay/codedfp/po/ As you can see thats my proxy web server i am making, BUT!!! When someone types a site, the site shows fine but when he or she clicks a link, the proxy ends and it goes to another webpage. www.hidemyass.com has the link in a HTTP_POST_VARS or something, how do i do this? Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 14, 2007 Author Share Posted November 14, 2007 help? Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 15, 2007 Share Posted November 15, 2007 Are you including the page in your page or using frames? Anyway I might be wrong but I think you may have to rewrite all the links on the page that you are opening to go through your proxy. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 15, 2007 Author Share Posted November 15, 2007 Are you including the page in your page or using frames? Anyway I might be wrong but I think you may have to rewrite all the links on the page that you are opening to go through your proxy. here is the code, and re-writting the links wouldnt make sense.... <?php $url = $_POST['name']; ob_start(); $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_VERBOSE, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($curl); $cache = ob_get_contents(); ob_end_clean(); // check for errors if (curl_errno($curl)) { trigger_error('<span class="style5">Sorry, the url you entered was not valid.</span>'); } curl_close($curl); abs(crc32($cache)); echo $cache; echo $output; ?> Quote Link to comment Share on other sites More sharing options...
MadTechie Posted November 15, 2007 Share Posted November 15, 2007 here is the code, and re-writting the links wouldnt make sense.... Why ? preg_replace would work! you maybe better off using sockets instead of curl! Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 15, 2007 Author Share Posted November 15, 2007 here is the code, and re-writting the links wouldnt make sense.... Why ? preg_replace would work! you maybe better off using sockets instead of curl! I get it now... preg_replace("<a href...",$with,$ouput) right? Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 15, 2007 Share Posted November 15, 2007 Rewrite the link to http://www.flash-portal.org/fpslay/codedfp/po/?link=somewhere.com and use curl to open the link And use $_GET to process the link Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 15, 2007 Author Share Posted November 15, 2007 Rewrite the link to http://www.flash-portal.org/fpslay/codedfp/po/?link=somewhere.com and use curl to open the link And use $_GET to process the link yes but, how would i change the all the links to <a href=?website="THE SITE" / > so confusing. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 15, 2007 Author Share Posted November 15, 2007 I got the links thingy fixed and everything is fine, except when i get the "?website=", it gives me the site with quotes around the HTTP_POST_VARS, how do you remove quotes from ?id="dfdfsdf" <?php if(!isset($_GET['website'])){ $url = $_POST['name']; } else { $url = htmlentities($_GET['website'], ENT_QUOTES); } ob_start(); $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_VERBOSE, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($curl); $cache = ob_get_contents(); ob_end_clean(); // check for errors if (curl_errno($curl)) { trigger_error('<span class="style5">Sorry, the url you entered was not valid.</span>'); } curl_close($curl); abs(crc32($cache)); echo $cache; echo str_replace('<a href=','<a href=http://www.flash-portal.org/fpslay/codedfp/po/completeRequest.php?website=', $output); ?> Quote Link to comment Share on other sites More sharing options...
Daukan Posted November 15, 2007 Share Posted November 15, 2007 use string_replace again str_replace('"', '', $website); Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 15, 2007 Author Share Posted November 15, 2007 I did, now the image links are broken again... <?php if(!isset($_GET['website'])){ $url = $_POST['name']; } else { $url = str_replace('"','',$_GET['website']); $url = stripslashes($url); } ob_start(); $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_VERBOSE, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $output = curl_exec($curl); $cache = ob_get_contents(); ob_end_clean(); // check for errors if (curl_errno($curl)) { trigger_error('<span class="style5">Sorry, the url you entered was not valid '.$url.'</span>'); } curl_close($curl); abs(crc32($cache)); echo $cache; echo str_replace('<a href=','<a href=http://www.flash-portal.org/fpslay/codedfp/po/completeRequest.php?website=', $output); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.