how to use $_POST to relocate few headers in a simpler way?
Really sorry if I didn't make the title more clear because I am not sure
how to express it in just few words.
Here is the thing, I have a dropdown list and let's say the list has the
values of
bbyc, dtc, atc, and so on maybe like 10 of them. And once if I choose the
bbyc in the dropdown list then the page will go to bbyc.php
this is what I did. But I'm wondering if I have 10 of them do I have it do
it ten times or there's an easier way?
if($_POST["location"] == "bbyc")
{
header('Location: bbyc.php');
}
if($_POST["location"] == "dtc")
{
header('Location: dtc.php');
}
if($_POST["location"] == "atc")
{
header('Location: atc.php');
}
P.S. I tried to search something related but I guess I'm not sure how to
use an exact word to express what I want so my searches don't work.
Anyways whoever replied thank~
No comments:
Post a Comment