Re: Submit forms

From: Date: Fri, 10 Aug 2001 14:52:50 +0000
Subject: Re: Submit forms
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11227@lists.php.net to get a copy of this message
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/> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

« previous php.db (#11227) next »