I'm trying to get multiple variables to work in the query string with PHP.
This is my code:
<?
$programme=$_GET['programme'];
switch ($programme) {
case 12578:
include("http://mysite1.com/programme/TopGear");
break;
case ER:
include("http://mysite1.com/programme/ER);
break;
default:
echo "page not found!!!!";
}
$hPage=$_GET['hPage'];
switch ($hPage) {
case 1:
include("page1.php");
break;
case 2:
include("page2.php");
break;
case 3:
include("page3.php");
break;
default:
echo "page not found!!!!";
}
?>
I'm trying to get the code so that the URL is similar to these:
http://www.autoweek.nl/carbase_data.php?id=45405&cache=no
http://library.digiguide.com/lib/programmenextshowing/238308&hPage=2
where the query string has multiple parameters.
Feel free to improve my code, and I will test it out.
(Note that the URLs are mapped using my Apache's httpd-vhosts.conf, so they are local only to one machine, using VirtualHosts directive).
I am testing these before I manage to get a live site configuration working.
Also, if anyone knows how to, how do I rewrite the query string in the question mark to the ampersand?
Thanks! :)