RE: [PHP] sending form values in http header?
| From: | Johnson, Kirk | Date: | Thu, 21 Feb 2002 15:41:02 +0000 |
| Subject: | RE: [PHP] sending form values in http header? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-85730@lists.php.net to get a copy of this message | ||
In the method line, the URL being POST'd to is form2.php, not form.php. Is
that the correct file name, or should that be form.php?
Kirk
> -----Original Message-----
> From: marcbey [mailto:marc@marcbey.de]
> Sent: Thursday, February 21, 2002 5:47 AM
> To: php-general@lists.php.net
> Subject: [PHP] sending form values in http header?
>
>
> is it possible to send variables in the header to the next script with
> an form?
>
> script<form2.php>:
>
> $ip = "192.168.0.90";
> $fp = fsockopen ( $ip, 80, $errno, $errstr, 30);
> $header ="POST /tests/form2.php HTTP/1.1\r\n";
> $header .="Accept: image/gif, image/x-xbitmap, image/jpeg,
> image/pjpeg,
> application/vnd.ms-excel, application/msword, */*\r\n";
> $header .="Referer:
> http://192.168.0.90/tests/form2.php?\r\n";
> $header .="Accept-Language: de\r\n";
> $header .="Content-Type: application/x-www-form-urlencoded\r\n";
> $header .="Accept-Encoding: gzip, deflate\r\n";
> $header .="User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
> 5.1)\r\n";
> $header .="Host: 192.168.0.90\r\n";
> $header .="Content-Length: 9\r\n";
> $header .="Connection: Keep-Alive\r\n";
> $header .="Cache-Control: no-cache\r\n\r\n";
>
> $header ."user=marc";
>
> fputs ( $fp, $header, strlen( $header ) );
>
> while ( !feof( $fp ) )
> {
> echo fgets( $fp,128 );
> }
>
> fclose($fp)
>
> and shoud connect to the script <form.php> and sending the
> variable user
>
> <html>
> <head>
> <?php
> if ( $HTTP_POST_VARS["user"] == "marc" )
> {
> echo "http_user ist marc";
> }
> else
> {
> echo "no user";
> }
> ?>
> <form name="form1" method="post" action="?">
> <input type="text" name="user">
> <input type="submit" name="Submit" value="Submit">
> </form>
> </body>
> </html>
>
> it doesent work, but why?
>
>
>
> --
> -------------------------------------------------------
> magic garden GmbH - Agentur für Informationsarchitektur
>
> Hermannstr. 15 - 70178 Stuttgart (Am Feuersee)
>
> www.magic-garden.de ¦ beyerlin@magic-garden.de
>
> Tel. (07 11) 619 57-42 ¦ Fax (07 11) 615 01 38
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>