Jump to content

Archived

This topic is now archived and is closed to further replies.

Hamlets666

Sending POST data via fsockopen

Recommended Posts

[code] <?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&email=blabla@inbox.lv&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?  ???

Share this post


Link to post
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=blabla@inbox.lv&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]

Share this post


Link to post
Share on other sites
try it this way then .
[code]
<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&email=blabla@inbox.lv&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]

Share this post


Link to post
Share on other sites
redarrow,  [i]HTTP/1.1 411 Length Required Server: nginx/0.4.0 Date: Sun, 08 Oct 2006 15:55:08 GMT Content-Type: text/html Content-Length: 180 Connection: close
411 Length Required
nginx/0.4.0[/i]

Share this post


Link to post
Share on other sites
try this please.
[code]
<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&email=blabla@inbox.lv&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]

Share this post


Link to post
Share on other sites
try my way then.

[code]


<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&email=blabla@inbox.lv&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]

Share this post


Link to post
Share on other sites
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=blabla@inbox.lv&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]

Share this post


Link to post
Share on other sites

×

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.