Man, I used a function called PostToHost which i got from here, but this is the reply I got. The URL needed a POST with two variables, I used the function PostToHost to send the variables but this is what the server replied:
HTTP/1.1 100 Continue Server: Microsoft-IIS/5.0 Date: Tue, 01 Apr 2003 08:44:08 GMT HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Tue, 01 Apr 2003 08:44:08 GMT Connection: close Set-Cookie: ASP.NET_SessionId=v4uxj355mztomk452cd1duj3; path=/ Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 304 Exception Error-2: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. Parameter name: length at System.String.Substring(Int32 startIndex, Int32 length) at WebPush.WebForm1.Page_Load(Object sender, EventArgs e) in C:\OMI\WebPush\Push.aspx.vb:line 128
Man, have to solve this fast. Deadline is fast approaching.
Function call was:
PostToHost("some.ip.address","/directory1/recipient.asp","variable1={$variable[$i]}&Webpage=http://some.domain.com/v3/messagebuilder.php?userid=$userid&recordid={$recordid[$i]}");
Function was :
function PostToHost($host, $path, $data_to_send)
{
$fp = fsockopen($host,80);
fputs($fp, "POST $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
fputs($fp, "Connection: close\n\n");
fputs($fp, $data_to_send);
while(!feof($fp))
{
echo fgets($fp, 128);
}
fclose($fp);
}
please help me guys. Help would be great... Thanks a lot!!!