Datuve :: Forums :: Arhīvs :: Datu iesūtīšana pa POST

Datuve

Mana Datuve

Reģistrācija | Noteikumi | Paroles atjaunošana



Forums

Ieskaties


Raksti

Lietotāji online

Lietotāji online: 69

Reģistrētie lietotāji online: 0

Viesi online: 69

Datuve.lv video
Top.LV

Datu iesūtīšana pa POST

Ievietoja: helpme2 @ 2006.10.08 18:26  

Šāds kods :

<?php

$x='name=BLA&pass=BLABLA&about=5c6b6c66&email=blabla@inbox.lv&rass=8013&height=175&mass=80';
$f=fsockopen('bla.bla.lv',80,$errno,$errstr,30);
if(!$f) {
echo "Socket error #$errno: $errstr";
} else {
$wr="POST /reg.php HTTP/1.1\r\nHost: bla.bla.lv\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);
}
?>

Bet rāda kļūdu :

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
411 Length Required