Announcement

Collapse
No announcement yet.

Quick question on Syntax of variables

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick question on Syntax of variables

    I have a quick and easy question for you...

    I need to set a variable in a PHP file to a number, and I need to be able to get the value of that variable from within a vB Template.


    So, I need help with the syntax of these two parts...


    For the PHP section, am I correct that all I need to do is something along the lines of this?

    $my_variable = 2;



    And then, the question is how do I work with the value of that variable from a vB template...

    I tried this, as an example:


    <if "$my_variable != 1">


    ...but it doesn't work. So obviously, I'm doing something wrong here.


    I would appreciate any help here. Thanks!
    echo $ocean_signature;

    ;)

  • #2
    the conditionals have a different syntax:
    PHP Code:
    <if condition="$my_variable != 1">foo</if> 
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment


    • #3
      Originally posted by Colin F

      the conditionals have a different syntax:
      PHP Code:
      <if condition="$my_variable != 1">foo</if> 

      Thanks, Colin - that did the trick perfectly!
      echo $ocean_signature;

      ;)

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X