How can I check captcha with PHP?

Can I check website down or not through IP using php script ?

  • hi, can i check website down or not through IP, lets me take an example, if i want to check google.com is down or not, and I using google.com IP that is "209.85.175.139", can i check it using IP ? i'm using this function but it seem dont work if i want to check using IP <?php function checksite($url) { $url = @parse_url($url); if (!$url) return false; $url = array_map('trim', $url); $url['port'] = (!isset($url['port'])) ? 80 : (int)$url['port']; $path = (isset($url['path'])) ? $url['path'] : '/'; $path .= (isset($url['query'])) ? "?$url[query]" : ''; if (isset($url['host']) && $url['host'] != gethostbyname($url['host'])) { $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30); if (!$fp) return false; fputs($fp, "HEAD $path HTTP/1.1\r\nHost: $url[host]\r\n\r\n"); $headers = fread($fp, 4096); fclose($fp); if(preg_match('#^HTTP/.*\s+[(200|301|302… $headers)) { return true; } else return false; } else return false; } ?> anyone ?

  • Answer:

    The code you provide is parsing urls not IP addresses. If you wanna use IP address instead, remove the $url part function checksite($ip) { ... $fp = fsockopen($ip, 80, $errno, $errstr, 30); ... } UPDATE: I did not manage to test if it works or not!

Altenato... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.