how to set global variable in PHPbb

Discussion in 'PHP' started by vinaysrao, Oct 2, 2008.

  1. #1
    Hi,

    I am new to Php. I want to know in which file should I include a variable name something like var_name="Y" so that I can get the value of var_name in all the code files of phpbb.

    Hope someone replies soon, before I lose my interest in modifing the code :)

    Thanks in advance.
     
    vinaysrao, Oct 2, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Any header file that is included by all phpBB files (like the sql or config files). No recent experience with phpBB, but I think this was the case when I had to modify it once. Use the built in $GLOBALS super-global so you can all it from functions. http://uk2.php.net/global - This will tell you more.

    Jay
     
    jayshah, Oct 2, 2008 IP
  3. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #3
    maybe you can add the variable into the includes/functions.php because all/most of the files include() it.
     
    ads2help, Oct 3, 2008 IP
  4. vinaysrao

    vinaysrao Banned

    Messages:
    225
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks will try it out
     
    vinaysrao, Oct 3, 2008 IP