hi,
i'm trying to submit a series of forms using php rather than javascript, to better control the windows the user is seeing. Basically, i need to submit $username and $passwd to an external site www.site.com, as well as log the action, and then open a given url on www.site.com in a new window.
I have tried submitting the form using
$fp = fsockopen("www.site.com", 80, &$errno, &$errstr, 30);
if(!$fp) { echo "$errstr ($errno)<br>\n"; }
else {
$path="/path.htm";
$vars="username=username&password=pass";
$url= $path."?".$vars;
fputs($fp,"POST $url HTTP/1.0\n\n");
while(!feof($fp)) {
echo fgets($fp,128);
}
fclose($fp);
}
The problem is that if the remote site tries to set a cookie, it doesn't set on the user's PC. How can i get this to work without having to parse the results of fgets ?
Nick