Hey all,
This is really simple but I just can't get it work. I have a drop down menu, you select your filter which will repost to the same page and grab that filter which will be used for an SQL query.
[PHP] $filter = $_POST['selectedFilter '];
if ($filter == "" || $filter == "All")
{
$query = "SELECT * FROM orders WHERE orderStatus = 'New'";
}
else
{
$query = "SELECT * FROM orders WHERE orderStatus = 'New' AND reviewType = '" . $filter . "'";
}
$result = mysql_query($qu ery);
?>
<form action="orders. php" method="post">
<select name"selectedFi lter">
<option value="">Review filter</option>
<option value="All">All </option>
<option value="Free">Fr ee</option>
<option value="Visual"> Visual</option>
<option value="Content" >Content</option>
<option value="Full">Fu ll</option>
</select>
<input type="submit" class="button2" value="Submit" />
</form>
<?php[/PHP]
When I use a GET method I can see the value in the address bar but I still can't access it with $_GET (it just comes up empty).
And that's the same with the $_POST it's not coming up with any value in the post. I've tried posting to another PHP file and I can get the same, the POST value is empty.
Any ideas?
Thanks
This is really simple but I just can't get it work. I have a drop down menu, you select your filter which will repost to the same page and grab that filter which will be used for an SQL query.
[PHP] $filter = $_POST['selectedFilter '];
if ($filter == "" || $filter == "All")
{
$query = "SELECT * FROM orders WHERE orderStatus = 'New'";
}
else
{
$query = "SELECT * FROM orders WHERE orderStatus = 'New' AND reviewType = '" . $filter . "'";
}
$result = mysql_query($qu ery);
?>
<form action="orders. php" method="post">
<select name"selectedFi lter">
<option value="">Review filter</option>
<option value="All">All </option>
<option value="Free">Fr ee</option>
<option value="Visual"> Visual</option>
<option value="Content" >Content</option>
<option value="Full">Fu ll</option>
</select>
<input type="submit" class="button2" value="Submit" />
</form>
<?php[/PHP]
When I use a GET method I can see the value in the address bar but I still can't access it with $_GET (it just comes up empty).
And that's the same with the $_POST it's not coming up with any value in the post. I've tried posting to another PHP file and I can get the same, the POST value is empty.
Any ideas?
Thanks
Comment