RE: [PHP] form variables showing blank but query shows non-blank ??

From: Date: Fri, 16 Feb 2001 06:16:02 +0000
Subject: RE: [PHP] form variables showing blank but query shows non-blank ??
Groups: php.general 
Request: Send a blank email to php-general+get-40112@lists.php.net to get a copy of this message
what about the form itself? I see no problems in here (except of course that you disclosed your mySQL host, login and password) Cheers, Maxim Maletsky -----Original Message----- From: Andre Bajew [mailto:AndreBajew@TechnologyArt.com] Sent: Friday, February 16, 2001 2:57 PM To: php-general@lists.php.net Subject: [PHP] form variables showing blank but query shows non-blank ?? 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 */ ............... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#40112) next »