I have a normal select box as can be seen below, in a separate class i have a number of php functions. I would like to be able to execute functions based on the select box.
<form action="functions.php" method"post">
<select name="sales">
<option value="week">Last 7 days</option>
<option value="month">Last 30 Days</option>
<option value="year">Last 365 Days</option>
<option value="all">Complete report</option>
</select>
<input type="submit" value="Submit" />
</form>
Then for example in my functions class i have functions function week(), function month(), function year(). I would like that when for example week is selected and submit is clicked that the week function would be executed, is there a simple method of doing this? Preferably on the same page but on a separate page would be fine.
what’s wrong with a simple if/else statement?