Re: Submitting "get" form
| From: | Chris Shiflett | Date: | Mon, 23 Aug 2004 00:59:42 +0000 |
| Subject: | Re: Submitting "get" form | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194442@lists.php.net to get a copy of this message | ||
--- Gerard Samuel <php-general@trini0.org> wrote:
> Say I have a form like ->
> <form action="./foo.php?id=20" method="get">
> ...
> <input type="submit"... />
> </form>
>
> If this form is submitted, the $_GET['id'] variable *is not* available.
> If the method is changed to "post", the $_GET['id'] variable *is*
> available.
>
> Is this how forms are supposed to work???
Yes, when you use the GET method, the query string of the URL that your
browser requests contains the form data. I think you want to have
something like this in your form:
<input type="hidden" name="id" value="20" />
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/