Alguien me podria como funciona el http post en php o como se hace necesito hacerlo con headers lo hago con winsocks en VB6 pero en php se me hace algo dificil
Ejemplo en VB you hago
Private Sub Command1_Click()
W.Close
W.Connect "www.habbo.es", 80
End Sub
Private Sub W_Connect()
Dim pack As String
login = "ownerAccountId=5195086&anAccountId=7644523"
pack = pack & "POST /myhabbo/avatarlist/avatarinfo HTTP/1.1" & vbCrLf
pack = pack & "Host: www.habbo.es" & vbCrLf
pack = pack & "Keep-Alive: 300" & vbCrLf
pack = pack & "X-Requested-With: XMLHttpRequest" & vbCrLf
pack = pack & "X-Prototype-Version: 1.6.0.2" & vbCrLf
pack = pack & "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" & vbCrLf
pack = pack & "Referer: http://www.habbo.es/home/chuchenco" & vbCrLf
pack = pack & "Connection: keep-alive" & vbCrLf
pack = pack & "Content-Length: " & Len(login) & vbCrLf & vbCrLf & login
MsgBox pack
W.SendData pack
End Sub
Private Sub W_DataArrival(ByVal bytesTotal As Long)
Dim data As String
W.GetData data
MsgBox data
End Sub
Private Sub W_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox Description
End Sub
aqui tengo los headers para imprimir
<?php
$data = 'ownerAccountId=5195086&anAccountId=7644523';
$header="POST /myhabbo/avatarlist/avatarinfo HTTP/1.1\r\n";
$header.="Host:
www.habbo.es\r\n";
$header.="Keep-Alive: 300\r\n";
$header.="X-Requested-With: XMLHttpRequest\r\n";
$header.="X-Prototype-Version: 1.6.0.2\r\n";
$header.="Connection: keep-alive\r\n";
$header.="Content-Length: ".strlen($data)."\r\n"."\r\n".$data;
echo $header;
?>
Pero no se como hacer el http post en PHP.