Forum Moderators: coopster
Using a $_GET I am trying to activate 1 of 2 switch commands depending on what the value of $_GET is. The Idea is if the one is active the other is dorment (displays another version of the site via a login script that functions correctly)
I realize that using an if statement or ternary operator could action one or the other, and when I use these methods I get both versions echo'd to the screen.
I have even tried using an exit; in the script, but that just kills the script.
Thanks for any suggestions.
Matthew
Once the login is successful send to a page called redirect. In the redirect page put this in
<?php
if($_GET['varName'] == "yourValue"){
header("Location: version1.html");
}//if
else{
header("Location: version2.html");
}//else
?>
Hope that helps. Like I said I'm not for sure I understand your problem. Explain in a little more detail.
Yes bad habit of mine to be a bit cryptic ;\
$first = isset($_GET['a']) ? strip_tags($_GET['a']) : $first = 'home';
$second = isset($_GET['b']) ? strip_tags($_GET['b']) : $second = 'home';
Depending on which gets populated first depends what version of the page is displayed.
Two switch statements are driven by two variables ($first & $second) then you can switch and change depending on what link is selected. I may end up just making two index files and selecting them through the url!
everything is driven by dynamic urls, the problem im getting is i get 2 different websites showing as both switches are engaging?!? I just need to turn one off when the other is active etc.
Cheers for the help.
Matthew
Now even if they are both set just check the times against each other.
$timeA = substr($_GET['a'], 4);
$timeB = substr($_GET['b'], 4);
$url = ($timeA < $timeB) ? urlA : urlB;
and then send them to $url.
Since I don't know how the get variables are being set, I really don't know if that helps or not. Let me know.
I have decided to alter the way the page is generated - just means creating another file, I had hoped to condense what is now two seperate files into a couple of extra paragraphs of code.
Thanks for the suggestion - the time stamp has given me an idea for something else, cheers
Matthew