I am currently learning MVC PHP, and have a dropdown menu on my localhost/dashboard/index
page (where dashboard
is the controller and index
is the method).
I understand how to, and have set up my .htaccess
to treat additional URL parameters as GET variables, but how do I send form data to those parameters? Let me explain.
A simple dropdown on my page:
<form action="<?=URL?>dashboard/index" method="get">
<select name="ID" onchange="this.form.submit()">
<option value="1">ID #1</option>
<option value="2">ID #2</option>
</select>
</form>
On submission, this takes me to localhost/dashboard/index/?ID=1
, but shouldn't I be writing my URL like localhost/dashboard/index/1
?
I can work with that GET within my controller and model no problem, but for conforming to standards, shouldn't it be using the controller/method/param/
format?