Jump to content


Photo

variable


  • Please log in to reply
3 replies to this topic

#1 otha

otha
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 September 2006 - 03:06 AM

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.';}
;
?>

#2 warewolfe

warewolfe
  • Members
  • PipPipPip
  • Advanced Member
  • 57 posts
  • LocationOtago, NZ

Posted 28 September 2006 - 03:19 AM

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 ...

#3 otha

otha
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 September 2006 - 03:32 AM

That is what I am trying to do but I get a parse error

#4 extrovertive

extrovertive
  • Members
  • PipPipPip
  • Advanced Member
  • 235 posts

Posted 28 September 2006 - 03:34 AM

<?
$topOpen= ($offsetf== "top");
if($topOpen)
{ echo $desireda  .'  Mils, Open at the top';}
else
{ echo abs(-$desireda)  .'  Mils, Open at the bott.';}
;
?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users