Can anyone please help me do this? I have a registration form that when submitted, only the text fields are inserted and saved in the database. I have one drop down selection menu for users to choose their state. When the form is submitted the state they selected is not inserted into the database, but all the other information is.
let me know if you need to see any more code.
I would really appreciate if someone could give me some pointers, or maybe even code that would work.
here is the code i have for the drop down
that code is in a file called form.inc.php with is included in the register.php file. the register.php file includes a file i have called functions.php.
here is the code in register.php that is supposed to "register" the user:
and here is the code in the functions.php file that the above code refers to:
what is wrong or needs to be fixed? I want the 'state' field in my table to just be populated with the state the user selected in the drop down. seems simple, but i am struggling with this. Thanks for all help in advance!!
let me know if you need to see any more code.
I would really appreciate if someone could give me some pointers, or maybe even code that would work.
here is the code i have for the drop down
Code:
<td><font size="2" face="Verdana"> <strong>State</strong></font></td>
<td>
<select name='State'>
<option value='Alabama'>Alabama
<option value='Alaska'>Alaska
<option value='Arizona'>Arizona
</select>
that code is in a file called form.inc.php with is included in the register.php file. the register.php file includes a file i have called functions.php.
here is the code in register.php that is supposed to "register" the user:
Code:
user_register ($_POST['username'], $_POST['password'], $_POST['email'], $_POST['firstname'], $_POST['lastname'], $_POST['address'], $_POST['city'], $_POST['state'], $_POST['zip']);
and here is the code in the functions.php file that the above code refers to:
Code:
function user_register($username, $password, $email, $firstname, $lastname, $address, $city, $state, $zip)
{
// Get a salt using our function
$salt = generate_salt();
// Now encrypt the password using that salt
$encrypted = md5(md5($password).$salt);
// And lastly, store the information in the database
$query = "INSERT INTO user (username, password, email, firstname, lastname, address, city, state, zip, salt) values ('$username', '$encrypted', '$email', '$firstname', '$lastname', '$address', '$city', '$state', '$zip', '$salt')";
$result = mysql_query($query) or die ('Could not create user.');
what is wrong or needs to be fixed? I want the 'state' field in my table to just be populated with the state the user selected in the drop down. seems simple, but i am struggling with this. Thanks for all help in advance!!








