You are here: 'Require' and 'Select' lists « PHP « IT news, forums, messages
'Require' and 'Select' lists

Posted by Andre Dubuc on 05/13/05 06:41

Hi,

I've had some rather odd intermittent behavior with a select list drawn by a
'require' on my production site. Sometimes, rather than displaying 'In
USA/Canada' from the '<option selected>In USA/Canada</option>' code in the
required file, it will display a blank. Yet, if I try to duplicate this
behavior on the development box, it will display as coded.

Since I use this text string as a validator for user input, it really messes
up the database/code functions that rely on it.

<?php require("provcountry.sty"); ?>

[snippet of 'require' text (provcountry.sty)]
<tr>
<td><b>State &nbsp;</b></td>
<td><SELECT NAME=selstate>
<option selected>In USA/Canada</option>
<option value="Alabama">Alabama</option>
.. . .
</SELECT></td>
</tr>

[snippet of some validating code verifying $selstate that relies on $selstate]

<?php
if (($_POST['selstate'] != "In USA/Canada")&&($_POST['typstate'] != ""))
die ("<h5><br><br>Please choose from 'In USA/Canada' or type in 'Other
State'.
<br>Do not use both<br><br>Click 'Back' on your browser to
re-enter information</h5>");
?>

Any ideas why this is happening?

Tia,
Andre

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация