Jump to content

Sending POST data via fsockopen


Hamlets666

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?  ???
Link to comment
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]
Link to comment
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]
Link to comment
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]
Link to comment
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]
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.