php5 conflict Parse error.

Discussion in 'PHP' started by dre, Jul 15, 2007.

  1. #1
    Im getting this error on line 15.

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

    If i comment out line 15, the file loads fine.

    Line 15:
    $public = ($_POST[public])?($_POST[public]):('0');
    PHP:
    I found this page thats explains a bit, but not sure how to change the line to make it legal with php5.
    http://oregonstate.edu/cws/docs/systems/software/php5troubleshooting
     
    dre, Jul 15, 2007 IP
  2. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #2
    public is a reserved word in PHP5
    you have to use single quotes in $_POST :

     
    gibex, Jul 15, 2007 IP