I have what should be a very simple question. I am using the following simple PHP if/else statement. When nomobile is not defined or not equal to "true", then the javascript shown below should execute. If it is equal to true, then it should not execute. However, the javascript is executing even when nombobile=true. There is probably a minor typo that is messing everything up, but I am driving myself crazy trying to find what is wrong and can't figure it out.
<?php
if ($_GET["nomobile"]!="true")
{echo '
<script type="text/javascript">
if (screen.width <= 699) {
document.location = "http://www.heliohost.org/m/";
}
</script>';}
else {} ?>
var_dump($_GET['nonmobile'])produce when added above theifstatement?$_GETvariable set to any other type than a string??nomobile=trueis tacked onto the end of the URL, and the javascript isn't there when?nomobile=trueisn't there. Also, using Firebug, I set a breakpoint on the conditional and it did fire. Check your values.