Jump to content

I think is PHP code is causing a bug in my application


twizboi

Recommended Posts

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();
}

 

Link to comment
Share on other sites

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) {
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.