Re: Submit forms
| From: | Ian Grant | Date: | Mon, 13 Aug 2001 11:33:53 +0000 |
| Subject: | Re: Submit forms | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11283@lists.php.net to get a copy of this message | ||
Yes, thank you, this works!
Ian.
Paul Burney <burney@gseis.ucla.edu> wrote in message
news:B7994352.2AFF%burney@gseis.ucla.edu...
> on 8/10/01 7:50 AM, Ian Grant at ian.grant@btinternet.com wrote:
>
> > I've got a simply search form, on my site using PHP and MySQL.
> > It writes a SELECT query using WHERE (<Field> LIKE '%thingy%') where
thingy
> > is the word entered in the form. It works fine if the submit button is
> > pressed, but if you press return after typing the word, instead, it
fails
> > and writes nothing for the query, so it ends up like WHERE ()
>
> Browsers differ on how they interpret the hitting of the return key and
> which fields get submitted. I'd guess you have an <input type='submit'
> name='submit' value='yes'> type field and you are checking
> isset($submit).
> Some browsers (Netscape on the Mac, for example) won't submit the
name-value
> pair associated with the button.
>
> One solution is to do this instead:
>
> <input type="hidden" name="submit" value="yes">
> <input type="submit" value="Search!">
>
> No matter how the form is submitted, the submit variable will be set to
yes.
>
> Sincerely,
>
> Paul Burney
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Paul Burney
> Webmaster && Open Source Developer
> UCLA -> GSE&IS -> ETU
> (310) 825-8365
> <webmaster@gseis.ucla.edu>
> <http://www.gseis.ucla.edu/>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>