Page 1 of 1

HTML form SELECT not posting

Posted: Thu Aug 28, 2014 9:37 pm
by donny
hello,

for some reason the select field on my form is not posting to the processing page using $_POST.. all other fields post fine.
the select field has a name assigned to it and each option has a value assigned to it.
i am posting using $_POST['select_field_name']

its worked on my other forms but for some reason not on this one.

Code: Select all

<form method="post" action="shipping_info_process.php" >
State: <select name"shipping_state">
	<option value="AL">Alabama</option>
	<option value="AK">Alaska</option>
	<option value="WI">Wisconsin</option>
	<option value="WY">Wyoming</option>
</select><br>
<input type="submit" value="Next">
</form>
process page

Code: Select all

<?
$shippingstate = $_POST['shipping_state'];
echo $shippingstate;
echo $_POST['shipping_State'];
?>
errors
Notice: Undefined index: shipping_state in /order/order/shipping_info_process.php
this is a example of code, also not working.

Re: HTML form SELECT not posting

Posted: Thu Aug 28, 2014 9:53 pm
by donny
i found a error in my code. thanks anyway

Re: HTML form SELECT not posting

Posted: Fri Aug 29, 2014 11:35 am
by aboulmaaly
try this code :
--------------------------------------------------------------------
<?
if($_POST['shipping_state']){
$shippingstate = $_POST['shipping_state'];
echo $shippingstate;
}
?>
-------------------------------------------------------------------
:D