navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

One for Tail

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> One for Tail
Page: [1]
 
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=


Page:   [1]

All Forums >> Web Development >> ASP and Database >> One for Tail
Page: [1]
Jump to: 1





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