form variables showing blank but query shows non-blank ??

From: Date: Fri, 16 Feb 2001 05:57:02 +0000
Subject: form variables showing blank but query shows non-blank ??
Groups: php.general 
Request: Send a blank email to php-general+get-40111@lists.php.net to get a copy of this message
Hi, I have a form that has 4 variables, one, $pass_category, being a select list. The form posts a php script. Once inside the PHP script if I have not selected one of the select list variables the value should be blank. If I echo this out the value shows as blank. However, I later check the value of the passed select list variable and it passes a "if > "" test which has me baffled. I don't have this problem with my three other variables that are just form fields versus a select list. Am I missing something basic or ?? What I'm doing here is building a SQL statement based on form variables. A snippet of the script is below. I'd sincerely appreciate any help or guidance!! Andre <?php mysql_close; $pass_category = $HTTP_POST_VARS["form_cat"]; $pass_company = $HTTP_POST_VARS["form_company"]; $pass_contact = $HTTP_POST_VARS["form_contact"]; $pass_sort = $HTTP_POST_VARS["form_sort"]; if ($debug =="y") { echo "Pass_category=$pass_category<br>"; /* This shows as blank */ echo "Pass_company=$pass_company<br>"; echo "Pass_contact=$pass_contact<br>"; echo "Pass_sort=$pass_sort<br>"; } $db = mysql_pconnect("mysql1:katychamber.com", "katyc2", "katyc2"); ............... ............... if ($pass_category > "") $sql2 = $sql2 . " and cat = '$pass_category' "; /* this statement passes this test even though it appears to be blank */ ...............

« previous php.general (#40111) next »