Re: Odd Behaviour: DIE function

From: Date: Fri, 26 Nov 2004 03:47:36 +0000
Subject: Re: Odd Behaviour: DIE function
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-202875@lists.php.net to get a copy of this message
Andre Dubuc wrote:
I've noticed some strange behaviour with respect to validation of user input. Normally, using Linux, the die function in user input validation works as expected. However, the same code in IE, the DIE function does not work as expected. I've noticed that fields, that should die and barf an error message, seem to allow no input. Often, I notice that the user has entered a different spelling as well. I'm puzzled by this (Furthermore, I wasn't aware the user could change the contents of a dropdown select list [I cannot duplicate it in Linux). Since one of the affected fields receives its input from an included file (provcountry.dpn), perhaps this ius an IE issue?? provcountry.dpn <td><b>Country &nbsp;</b></td> <td><SELECT NAME=rcountry> <option selected>Choose from List <OPTION>USA /* list of countries follows */ snippet code in validation page: <?php ... if ($_POST['rcountry'] == "Choose from List") die ("<h5><br><br>Please choose your Country from the drop-down list<br><br><br>Click 'Back' on your browser to enter this information</h5>"); ... ?> Any pointers of what I'm missing here would be appreciated. Tia, Andre the <option>-element needs an ending-element. <option>value</option> Some browsers may include a space at the end of the string.
I think this is the most "correct" syntax: <option value="something">Text to show</option> where "something" is what is sent as value when posting.

« previous php.general (#202875) next »