Jump to content

[SOLVED] socket


konnwat

Recommended Posts

Hey i made a nice bot that opens a socket, gets some html, parses it and adds the information to a db.

but... the site now needs you to be logged in to view the source!  :o

 

so how would i go about making it log in?  :-\

 

i was thinking sending some headers to the socket that has the session cookie in them but i dont know how i would do that :-X

 

here is my code...

<?php
$fp = fsockopen("www.barafranca.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET /compress.php?r=stats.inc HTTP/1.1\r\n";
$out .= "Host: barafranca.com\r\n";
$out .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204\r\n";
$out .= "Connection: Close\r\n\r\n";
$file = '';
fwrite($fp, $out);
while (!feof($fp)) {
	$file .= fgets($fp, 128);
}
fclose($fp);
}
?>

Link to comment
https://forums.phpfreaks.com/topic/53000-solved-socket/
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.