if statement - Weird if elseif logic in PHP -
i have page displays html based on query string loaded in url.
here sample of code.
<?php // grab querystring section $w = getquerys('section'); if ($w == "main") {?>
display html version one
<? } else if ($w == 'types') {?>
display html version two
<?php } ?>
for reason, logic works fine on web hosting site, not on workstation using xampp. when run on workstation, both html version 1 , tow displayed @ same time on page.
i'm afraid i'm @ bit of loss this. i've confirmed getquerys function works fine echoing out $w variable.
thanks in advance can provide.
you mixing php shorts tags long tags. expect xampp doesn't have short tags enabled, change following line:
<?php } else if ($w == 'types') {?>
Comments
Post a Comment