Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation Need help with PHP error message.

    Good Day, as you all can see I'm a newbie to Coding Forums and PHP programming. I need some help with a personal project i'm working on.

    I downloaded a freelance script. Everything seems to be working fine, but i'm getting an error message when I try to do one or two functions.

    This is the error message:

    Parse error: syntax error, unexpected T_PRIVATE, expecting ']'


    If you guys have an idea of what's wrong or have seen this before or can point me in the right direction, I will appreciate it.

    Thanks in advance.

    GemGfx

  • #2
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    6
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hey folks,

    I've found the solution to the error message.

    The issue was a missing "$" before a variable named "private". Apparently "private" is a keyword in php and when using a variable even in [] you still need to include the "$".

    So yes problem solved and the code now works. Thanks.

    GemGfx

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Hold on a minute.
    Yep, private is a keyword in PHP5+. However, if the script does not make use of a $ in the first place, I'm inclined to think that it was originally created as a defined constant instead of as a variable. That I can't confirm or deny though.
    What you can do, is do a print_r(get_defined_constants(true)); to see if one exists under private.

    Edit:
    Wait, it almost sounds like you're meaning an hashmap index. Can you post the code in question (where you're talking about the [] please)
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •