twizboi Posted January 30, 2019 Share Posted January 30, 2019 So I have an webapp which has a built in proxy checker. However because I didn't write the code I am kind of confused on whats going on. I have a small amount of knowledge on php been looking all over the net to find a solution. So this file called (proxy_check.php) keeps causing my index.php to show the 404 designed page. The file is required in the index.php file. I believe its something to do with the $reponse variable. Please help <?php # Visitor proxy check snippet $v_ip = $_SERVER['REMOTE_ADDR']; $arContext['http']['timeout'] = 10; $context = stream_context_create($arContext); $response = file_get_contents('http://www.shroomery.org/ythan/proxycheck.php?ip='.$v_ip, 0, $context); if ('Y' === $response) { echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'> <head> <title> The page you were looking for doesn't exist (THIS BUG)</title> <style type='text/css'> body { background-color: #efefef; color: #333; font-family: Georgia,Palatino,'Book Antiqua',serif;padding:0;margin:0;text-align:center; } p {font-style:italic;} div.dialog { width: 490px; margin: 4em auto 0 auto; } img { border:none; } </style> </head> <body> <div class='dialog'> <a><img src='assets/img/404.png'></a> <p>It looks like that page you were looking has been mislaid, sorry.</p> </div> </body> </html>"; die(); } Quote Link to comment Share on other sites More sharing options...
requinix Posted January 30, 2019 Share Posted January 30, 2019 Seems fine. Is the value of $v_ip what you expect it to be? Quote Link to comment Share on other sites More sharing options...
twizboi Posted January 30, 2019 Author Share Posted January 30, 2019 Yes. However when I try to view my index.php it echos the response as if my local computer is using a proxy. $response = file_get_contents('http://www.shroomery.org/ythan/proxycheck.php?ip='.$v_ip, 0, $context); if ('Y' === $response) { Quote Link to comment Share on other sites More sharing options...
requinix Posted January 30, 2019 Share Posted January 30, 2019 What do you see if you go to http://www.shroomery.org/ythan/proxycheck.php?ip=<the value from $v_ip>? Quote Link to comment Share on other sites More sharing options...
twizboi Posted January 30, 2019 Author Share Posted January 30, 2019 Nothing... that link don't exist Quote Link to comment Share on other sites More sharing options...
requinix Posted January 31, 2019 Share Posted January 31, 2019 Sure it does. I just tried it with your IP address and the service said "N". Quote Link to comment Share on other sites More sharing options...
twizboi Posted January 31, 2019 Author Share Posted January 31, 2019 So how comes its does not render the site but shows the 404 page? Quote Link to comment Share on other sites More sharing options...
requinix Posted February 1, 2019 Share Posted February 1, 2019 Don't know yet, you haven't been able to answer my latest question. On 1/30/2019 at 2:00 PM, requinix said: What do you see if you go to http://www.shroomery.org/ythan/proxycheck.php?ip=<the value from $v_ip>? 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.