HTML form SELECT not posting

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

HTML form SELECT not posting

Post 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.
donny
Forum Contributor
Posts: 179
Joined: Mon Aug 11, 2014 11:18 am

Re: HTML form SELECT not posting

Post by donny »

i found a error in my code. thanks anyway
aboulmaaly
Forum Newbie
Posts: 1
Joined: Fri Aug 29, 2014 11:32 am

Re: HTML form SELECT not posting

Post by aboulmaaly »

try this code :
--------------------------------------------------------------------
<?
if($_POST['shipping_state']){
$shippingstate = $_POST['shipping_state'];
echo $shippingstate;
}
?>
-------------------------------------------------------------------
:D
Post Reply