No announcement yet.

displaying a variable and then setting it

  • Filter
  • Time
  • Show
Clear All
new posts

  • displaying a variable and then setting it

    I know that in PHP4 there's an option where you can display a variable, and then later set it to what you need it to be like I have a single php page that will show the user diffrent information based on the user input, and in the header file, I put this code:

    print "&$headtitle";

    and later on within my if statements i would put
    $headtitle="Option 1 selected";

    and by what my book tells me, "Option 1 selected" should show up in the title bar, but it doesn't, all I get is an & in the title bar


    Last edited by Dimava; Mon 22 Jul '02, 8:57pm.
    NXSupport Admin

  • #2
    Using the ampersand passes a variable by reference to another variable, meaning whichever happens to the referenced variable happens the to variable being referenced.

    A variable cannot be used before it is defined.


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