RE: [PHP] Getting Information from a CGI POST

From: Date: Mon, 02 Jul 2001 04:01:19 +0000
Subject: RE: [PHP] Getting Information from a CGI POST
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-55780@lists.php.net to get a copy of this message
On 02-Jul-01 Clayton Dukes wrote: > Hi everyone, > > Is it possible to get information from a POST to a cgi and return the value? Yes. function openpost($host, $path, $poststr) { $errno=0; $errstr=''; $hdr=sprintf("POST /%s HTTP/1.0\r\nContent-Length: %d\r\n", $path, strlen($poststr)); $hdr .="Content-type: application/x-www-form-urlencoded\r\n"; $hdr .="Accept: text/html\r\nAccept: text/plain\r\n"; $hdr .="User-Agent: Mozilla/1.0\r\n\r\n"; $fp = fsockopen($host , 80, &$errno, &$errstr, 45); if (!$fp) { echo "$host open error: $errstr $errno .\n"; return(0); } else { fputs($fp,$hdr.$poststr); return($fp); } } while (!feof($fp)) { $buff=fgets($fp, 1024); dofoo($buff); } fclose($fp); > Isn't there a way to have PHP go and check this onec every x minutes and > return the status? Yep, there is. > > Can this be done? Yes. Regards, -- Don Read dread@texas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

« previous php.general (#55780) next »