Re: Can you insert into $_POST manually?

From: Date: Thu, 09 Jan 2003 13:33:57 +0000
Subject: Re: Can you insert into $_POST manually?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-130935@lists.php.net to get a copy of this message
"Noel Wade" <noelwade@attbi.com> a écrit dans le message news: 20030109122323.82315.qmail@pb1.pair.com... > Thanks - I understand that method; but I'm really looking for a way to pass > them without them being visible / mucking up the URL line with a buncha > stuff... (Note that even with a post, the data aren't really hidden : they are in the http content.) >So I have a page that processes information and then "echo"s out a redirect >that looks like this: ><META HTTP-EQUIV="REFRESH" CONTENT="4; URL=<? echo $url ?>;"> If you can't call your page with a "real" post (a form submitted), it would be possible to simulate it with this function (from Rasmus Lerdorf, AFAIK) : 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); } with $data_to_send = "formfield1=myfieldvalue1&formfield2=myfieldvalue2"; Otherwise, easier, couldn't you use sessions ? you would hide your $url into $_SESSION['url'] Regards, Philippe

« previous php.general (#130935) next »