otha Posted September 28, 2006 Share Posted September 28, 2006 Anyone have an idea why this won't work as a variable<?$topOpen=if ($offsetf== top ){ echo $desireda .' Mils, Open at the top';}else{ echo abs(-$desireda) .' Mils, Open at the bott.';};?> Quote Link to comment Share on other sites More sharing options...
warewolfe Posted September 28, 2006 Share Posted September 28, 2006 You seem to be assigning $topOpen the results of an if else.which should get you an error of PHP Parse error: parse error, unexpected T_IF in ... Quote Link to comment Share on other sites More sharing options...
otha Posted September 28, 2006 Author Share Posted September 28, 2006 That is what I am trying to do but I get a parse error Quote Link to comment Share on other sites More sharing options...
extrovertive Posted September 28, 2006 Share Posted September 28, 2006 <?$topOpen= ($offsetf== "top");if($topOpen){ echo $desireda .' Mils, Open at the top';}else{ echo abs(-$desireda) .' Mils, Open at the bott.';};?> 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.