A form variable is not being inserted into DB

I have a form field called, “member” that is no longer being inserted into the DB when the user clicks submit. Can someone help me see what I’m missing? Here are the relevant bits of code:

When viewing the form:


<select name="member" class=form id="member">
<option value="No">No</option>
<option value="Customer">Customer</option>
<option value="Distributor">Distributor</option>
</select>

When processing the form:


$member 		= $_REQUEST['member'];

mysql_query ("INSERT INTO users (firstname, lastname, member, membernumber) VALUES (
'$firstname', 
'$lastname', 
'$member',
'$membernumber')");

Is there anything wrong with what I have?

Thanks!

Is $_REQUEST[‘member’] being populated? Have you echo’d $member to make sure the value is making it through?

Also, are you sanitizing the variables before they get to the query, like using mysql_real_escape_string()?

<select name="member" class=form id="member">

<option value="No">No</option>

<option value="Customer">Customer</option>

<option value="Distributor">Distributor</option>

</select> 

Your html has broken tags, try this

<select name=“member” class=“form” id=“member”>

<option value=“No”>No</option>

<option value=“Customer”>Customer</option>

<option value=“Distributor”>Distributor</option>

</select>

Ok, when I echo the variable it appears that its not making it through. The weird thing is that my site has been running for 7 years and I don’t think I’ve messed with this variable. All other variables are making it through. Any ideas on what I’m overlooking?

Thanks!

If your form uses the POST method, then access the variable with $_POST[‘member’].

If your form uses the GET method, then access the variable with $_GET[‘member’].

I changed from using _REQEST to _POST and still $member is not being pulled through. Any other thoughts?

Thanks

Need to see the full code for the form.

Ok, I got it to work by adding the variable to the session after retrieving it using POST, like this:

$member  = $_POST['member'];

$_SESSION['member'] = $_POST['member'];

Can anyone explain why this is the only variable on my form that requires this? Ugh, very frustrating.

again, without seeing your code, all I can do is point and say ‘look, it works’.