php socket http get request
Yeni nesil browserlar otomatik encode eder yolladığımız veriyi (php sürümlede alakası var) geçenlerde ihtiyacım olmuştu yazmıştım paylaşayım belki kullanan olur
function Http_Get_Request($host, $packet)
{
if (!($socket = fsockopen($host, 80)))
die( "\n[-] Connection Error :( {$host}:80\n");
fwrite($socket, $packet);
return stream_get_contents($socket);
}
$host="127.0.0.1";
$path="/index.php?id=1 2";
$packet = "GET {$path} HTTP/1.0\r\n";
$packet .= "Host: {$host}\r\n";
$packet .= "Connection: close\r\n\r\n";
echo Http_Get_Request($host, $packet);



