I'm trying to use the query from a GET url to determine the content of a page. This is what I have (sentences edited for clarity):
<?php
//decalre variables
$title ='';
$welcome = '';
$params = '';
$params = $_SERVER['QUERY_STRING'];
echo $_SERVER['QUERY_STRING'];
echo $params;
if ($params='') {
header('start.html') ;
} else {
if ($params === "selection=republic") {
//echo $params;
//echo 'Republic';
$title = "Private";
$welcome = "Our .";
$signoff = "The Republic will strike back!";
}
else if ($params === "selection=rebels") {
//echo $params;
//echo 'Rebels';
$title = "Comrade";
$welcome = "Hey comrade, welcome to the Underground Network!";
$declaration="You see,o's!";
$signoff = "Rebel!!";
}
else if ($params === "selection=robots"){
//echo $params;
//echo 'Robots';
$title = "Bit";
$welcome = "Our data ";
$declaration="Knowledge w.";
$signoff = "ed now.";
}
else {
echo 'There was an error - please go back.';
}
}
The first echo shows the correct URL, but the comparison gets stuck at the third option. Help!