on 8/10/01 7:50 AM, Ian Grant at [EMAIL PROTECTED] 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.


Paul Burney

Paul Burney
Webmaster && Open Source Developer
(310) 825-8365

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to