|
| |
|
|
ThomasMobley
Posts: 89 Joined: 9/8/2007 Status: offline
|
One for Tail - 10/11/2007 17:28:19
I wrote some javascript validation for a guy whose posted form goes to another site. He wanted me to do some backup checking as well if javascript was disabled, and my php works for the validation part of it, but I'm having real problems doing a post from my php to either the next site or back to my test site. Here is the pertinent part of the checking code which should either post the data to the next site if it's valid, or post it back to the form if it's not valid. I just get an errno of "" and an errstr of "". I've tried get as well, and it seems to work some times and not work the next time, but when it doesn't work I just get no error values returned. $ReqHeader = "POST $URI HTTP/1.1\n". "Host: $Host\n". "Content-Type: application/x-www-form-urlencoded\n". "Content-Length: ".strlen($redirFields)."\n\n". "$redirFields\n"; echo "$ReqHeader<br/>"; // Open the connection to the host $socket = fsockopen($Host, 80, &$errno, &$errstr); if (!$socket) { $Result["errno"] = $errno; $Result["errstr"] = $errstr; echo "<br/>errno is ".$errno; echo "<br/>errstr is ".$errstr; } else { $idx = 0; echo "putting<br/>"; fputs($socket, $ReqHeader); echo "whiling<br/>"; while (!feof($socket)) { $Result = fgets($socket, 128); echo "$Result <br/>"; } fclose($socket); echo "done with $Result"; } $ReqHeader echos as follows POST /index.asp HTTP/1.1 Host: www.faggotsinthefire.com Content-Type: application/x-www-form-urlencoded Content-Length: 127 fields_fname=&fields_lname=&fields_email=&fields_address1=&fields_phone=&fields_city=&fields_zip=&fields_state=&fields_country=
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|