use of undefined constant

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cassbiz
    New Member
    • Oct 2006
    • 202

    use of undefined constant

    I just upgraded to PHP5 and now most of my stuff doesn't work :(

    In the error log I am getting a string (this happens on every call to the language file)

    Code:
    PHP Notice:  Use of undefined constant Welcome - assumed 'Welcome' in /includes/en.php on line 206
    The language file is being called by
    Code:
    include $include_path."en.php";

    The string that I am using is in the pages are
    Code:
    echo "{$t_admin['Welcome']}";
    Here is a snippet from the en.php
    Code:
    $t_admin[Welcome] =     "Welcome";

    If anyone can see the error here I would greatly appreciate it. My next task will be to find out why all the dates have reverted to 31.12.1969
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Originally posted by cassbiz
    I just upgraded to PHP5 and now most of my stuff doesn't work :(

    In the error log I am getting a string (this happens on every call to the language file)

    Code:
    PHP Notice:  Use of undefined constant Welcome - assumed 'Welcome' in /includes/en.php on line 206
    The language file is being called by
    Code:
    include $include_path."en.php";

    The string that I am using is in the pages are
    Code:
    echo "{$t_admin['Welcome']}";
    Here is a snippet from the en.php
    Code:
    $t_admin[Welcome] =     "Welcome";

    If anyone can see the error here I would greatly appreciate it. My next task will be to find out why all the dates have reverted to 31.12.1969
    You need to enclose the key name in quotes if it is not a variable:
    [PHP]
    $t_admin[Welcome]; // ERROR
    $t_admin['Welcome']; // Correct
    $index = "Welcome";
    $t_admin[$index]; // Correct
    [/PHP]

    Comment

    • cassbiz
      New Member
      • Oct 2006
      • 202

      #3
      Thank that helped and corrected the errors.

      Any ideas on why all of my calendars and such would have reverted back to 31.12.1969?

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        Originally posted by cassbiz
        Thank that helped and corrected the errors.

        Any ideas on why all of my calendars and such would have reverted back to 31.12.1969?
        No idea.
        Perhaps if you post some erroneous code, I could help.

        Comment

        • cassbiz
          New Member
          • Oct 2006
          • 202

          #5
          Originally posted by Motoma
          No idea.
          Perhaps if you post some erroneous code, I could help.
          Let me get back to you on that.

          LOL

          I think I just found my stupid pills and now have to look at what is (most likely) causing the problem.

          Thanks for the help.

          Comment

          Working...