Jump to content

Sending POST data via fsockopen


Hamlets666

Recommended Posts

[code] <?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';
$f=fsockopen('dyzyag.jino-net.ru',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {
$wr="POST /reg.php HTTP/1.1\r\nHost: dyzyag.jino-net.ru\r\n\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: ".strlen($x)."\r\n\r\n".$x;
fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,1024);
}
fclose($f);
}
?> [/code]

And there is error - HTTP/1.1 411 Length Required Server: nginx/0.4.0 Date: Sun, 08 Oct 2006 09:19:14 GMT Content-Type: text/html Content-Length: 180 Connection: close
[b]411 Length Required[/b]

Could you help me with this error?  ???
Link to comment
https://forums.phpfreaks.com/topic/23339-sending-post-data-via-fsockopen/
Share on other sites

try this ok

example only always backup your own code incase this dosent work.

[code]
<?php
$x='name=BLA&pass=BLABLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';
$fp = fsockopen("dyzyag.jino-net.ru", 80, $errno, $errstr, 30);
if (!$fp) {
   echo "$errstr ($errno)<br />\n";
} else {
   $out = "GET / HTTP/1.1\r\n";
   $out .= "Connection: Close\r\n\r\n";

   fwrite($fp, $out);
   while (!feof($fp)) {
       echo fgets($fp, 128);
   }
   fclose($fp);
}
?>
[/code]
try it this way then .
[code]
<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';
$j="POST /reg.php HTTP/1.1\r\nHost: dyzyag.jino-net.ru\r\n\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: ".strlen($x)."\r\n\r\n".$x;

$f=fsockopen('dyzyag.jino-net.ru',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {
$wr= $j;
fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,1024);
}
fclose($f);
}
?>
[/code]
try this please.
[code]
<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';


$f=fsockopen('dyzyag.jino-net.ru',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {

$wr="POST /reg.php HTTP/1.1\r\nHost: dyzyag.jino-net.ru\r\n";

$wr.="Content-Type: application/x-www-form-urlencoded\r\nContent-Length: ".strlen($x)."\r\n\r\n".$x";



fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,1024);
}
fclose($f);
}
?>
[/code]
try my way then.

[code]


<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';


$f=fsockopen('dyzyag.jino-net.ru',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {

$wr="POST /reg.php HTTP/1.1\r\nHost: dyzyag.jino-net.ru\r\n";

$wr.="Content-Type: application/x-www-form-urlencoded\r\n";

$wr.="User-Agent: Mozilla 4.0\r\nContent-length: ";

$wr.=strlen($x)."\r\nConnection: close\r\n\r\n$x";

fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,1024);
}
fclose($f);
}
?>

[/code]
Could I ask for some more help? Like - I wanted to use anonymouse.org to send in POST data like this :

[code]<?php

$x='name=BLsAx&pass=BLxAsBLA&about=5c6b6c66&[email protected]&rass=8013&height=175&mass=80';


$f=fsockopen('anonymouse.org',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {

$wr="POST /cgi-bin/anon-www.cgi/http://dyzyag.jino-net.ru/reg.php HTTP/1.1\r\nHost: dyzyag.jino-net.ru\r\n";

$wr.="Content-Type: application/x-www-form-urlencoded\r\n";

$wr.="User-Agent: Mozilla 4.0\r\nContent-length: ";

$wr.=strlen($x)."\r\nConnection: close\r\n\r\n$x";

fputs($f,$wr);

while(!feof($f)) {
echo fgets($f,1024);
}
fclose($f);
}
?>[/code]

And with this code POST data wasn`t sended :(




[b] EDIT :[/b] [i]My error : :-\ I didn`t changed Host: dyzyag.jino-net.ru to anonymouse.org[/i]

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.