I am new to both html and php and I am trying to create a form that you have one text box with buttons that allow you to search for the item in the text box in the last 24, 48,72 hours.
One the html side of things my form looks like this:
<form action="test.php" method="GET">
<input type="text" name="query" />
<input type="submit" value="Search" />
<input type="submit" name="oneday" value="Last 24 hours">
<input type="submit" name="twoday" value ="Last 48 hours"/>
<input type="submit" name="threeday" value="Last 72 hours"/>
</form>
When it gets the php it seems to always search for query and not the other values.
php code is :
<?php
$query = $_GET['query'];
$queryo = $_GET['oneday'];
$querytwo = $_GET['twoday'];
$queryth = $_GET['threeday'];
$min_length = 3;
if($query) >= $min_length){
mysql command
else{
if($queryo) >= $min_length){
mysql command
else{
if($querytwo) >= $min_length){
mysql command
}
I am very new to coding and have never done any web stuff at all so any help would be great. I am guessing I am missing something in front of my face but need a point or some help.
Thank you in advance.