wmguk Posted March 11, 2008 Share Posted March 11, 2008 hey, I keep getting a blank page, <? $order = $_GET['order']; $order2 = $_GET['order']; if $order = "" { $order = "albumname ASC"; } else { $order = $_GET['order']; } ?> page url is show.php and i want it to look, if show.php isnt passing $order in the URL then set $order as albumname ASC, if it is showing $order in the url then display the whole page.. what am i missing? Quote Link to comment Share on other sites More sharing options...
discomatt Posted March 11, 2008 Share Posted March 11, 2008 You have to use == singe = denotes definition, double = (==) checks for equality. Quote Link to comment Share on other sites More sharing options...
wmguk Posted March 11, 2008 Author Share Posted March 11, 2008 I just had a play, realising the code was rough, and this is what i now have, <? $order == $_GET['order']; if $order == "" { $order == "albumname ASC"; } else { $order == $_GET['order']; } $order2 == $order ; ?> but still totally white page, Quote Link to comment Share on other sites More sharing options...
Psycho Posted March 11, 2008 Share Posted March 11, 2008 Um, what? First off there is nothing in that code that would output anything to the page. Seconds, you changed the definitions to cmparisons as well (which shouldn't be). Third why would the code go through the logic to determine the value of $order, just to then define $order2 to be the same? <?php $order = (empty($_GET['order'])) ? "albumname ASC" : $_GET['order'] ; echo $order; ?> Quote Link to comment Share on other sites More sharing options...
wmguk Posted March 11, 2008 Author Share Posted March 11, 2008 $order2 needs to be the same as $order, for use in a different script, however to make things simple i could just use the same variable name... Thanks for helping with that, I completely lost my way! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.