This is going to sound really stupid, but I cannot figure out why I am getting this error.
I have created a selection box, named "query_age" in my html form:
<form method="get" action="user_list.php"> <select name="query_age"> <option value="">Doesn't matter</option> <option value="between 18 and 30">18 - 30</option> <option value="between 31 and 40">31 - 40</option> <option value="between 41 and 50">41 - 50</option> <option value="between 51 and 60">51 - 60</option> <option value="between 61 and 70">61 - 70</option> <option value="between 71 and 80">71 - 80</option> <option value="between 81 and 90">81 - 90</option> <option value="> 90">Older than 90</option> </select> In the corresponding php form, I have:
$query_age = $_GET['query_age']; When I run the page, I get this error:
Notice: Undefined index: query_age in index.php on line 19
I don't understand why this is happening, and I'd love to know how to make it go away.
print_r($_GET)show? Are other form values there? Why don't you use POST?user_list.phpas you have specified this in the form's action? It would help if you could post relevant code ofindex.phpand explain the general "flow" of your application.