Re: [PHP] 12 seconds!?!?

2003-12-02 Thread Burhan Khalid
Comex wrote:

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?
Probably because the board that you are trying to spam ... err ... login 
to is configured to allow a delay before posts. VB has this option.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---
Documentation is like sex: when it is good,
 it is very, very good; and when it is bad,
 it is better than nothing.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] 12 seconds!?!?

2003-12-01 Thread Comex
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];
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php