Have html links including a variable.
<a href="cwexchange.php?o=opt1" id="opt1" title="Opt1">Option1</a>
<a href="cwexchange.php?o=opt2" id="opt2" title="Opt2">Option2</a>
which goes to next page, and for some reason I am getting always option 1 when I echo the citi variable even when I have clicked option2 and it shows in the address bar. Did I miss something here?
$cit = "";
$citi = "";
// Make sure the _GET cit is set, and sanitize it
if(isset($_GET["o"])){
$cit = preg_replace('#[^a-z0-9]#i', '', $_GET['o']);
} else {
header("location: example.org");
exit();
}
//////////option page routing
if ($cit = "opt1"){$citi = 'Option 1';}
else if ($cit = "opt2"){$citi = 'Option 2';}