12 seconds!?!?

From: Date: Tue, 02 Dec 2003 00:50:18 +0000
Subject: 12 seconds!?!?
Groups: php.general 
Request: Send a blank email to php-general+get-171525@lists.php.net to get a copy of this message
I have a script that replicates a human on a message board, and its logs (logging in, going to inventory, etc.) occur every 12 (no more no less) seconds. Do you know why? function sendreq($addy,$type,$content = "",$cookie = "",$useragent="------------",$host="-----------") { $msg = strtoupper($type); // get or post $msg .= " "; $msg .= $addy; $msg .= " HTTP/1.1\r\n"; $msg .= "Host: $host\r\n"; $msg .= "User-agent: $useragent\r\n"; if($cookie != "") $msg .= "Cookie: $cookie\r\n"; if (strtolower($type) == 'post') { $msg .= "Content-type: application/x-www-form-urlencoded\r\n"; $msg .= "Content-length: "; $msg .= strlen($content); $msg .= "\r\n\r\n"; $msg .= $content; } else { $msg .= "\r\n"; } //message is prepared! $fp = fsockopen ($host, 80, $errno, $errstr, 30); if (!$fp) { die("$errstr ($errno)<br>\n"); } else { fputs ($fp, $msg); while (!feof($fp)) { $result.= fgets ($fp); } fclose ($fp); } return $result; } function extractcookie($result) { preg_match_all("!Set-Cookie: (.*);!",$result,$matches); $matches = $matches[1]; return $matches[count($matches)-1]; }

« previous php.general (#171525) next »