i have this code here (simplified it a bit for this but you get the idea!) and i have assigned the name field of a select tag with a value of a variable so that when i click the Update button i can use _POST[name_var] to get the value of the select. however this returns the following error:
"Notice: Undefined index: 62"
if i manually put 62 in the name field and in the _POST[62] it does work so there is no problem with the rest of my code.
if anyone could tell me what i need to do to make this work i would be greatly appreciative!
Thanks in advance
Ollie
"Notice: Undefined index: 62"
if i manually put 62 in the name field and in the _POST[62] it does work so there is no problem with the rest of my code.
if anyone could tell me what i need to do to make this work i would be greatly appreciative!
Thanks in advance
Ollie
Code:
//role.php file <?php $name_var = 62; echo '<form method="POST" action="update_role.php">'; echo '<select id="dropdown" name=$name_var>'; //option tags in here... echo '</select>'; echo '<input type="submit" name="btn_update" id="button" value="Update" />'; echo '</form>'; ?> //update_role.php file <?php $name_var = 62; $getVar = _POST[$name_var]; ?>
Comment