Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

php query

Options
  • 16-04-2004 5:44pm
    #1
    Closed Accounts Posts: 4,655 ✭✭✭


    I recently set up php on my computer in work, everything is running fine, etc except for one small problem


    Normally I have made an if statement relating to a variable I get no error message, e.g.

    if ($id == ""){
    echo "";

    }


    However on a particular page I have a similiar statement made, but for the moment I am not passing a variable to that page and its giving me the following error message

    "Undefined variable: id Line xxx"

    What do I have to edit in the php.ini file to ensure this does not happen?


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    See error_reporting. It's better practise to leave error_reporting set high though, and use isset() and empty() instead. That is, you should be checking to see if the variable is initialised before you check its contents.

    adam


  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    update on this problem:

    checked php.ini, and found that warnings were set to ALL, which I didnt need, so I just changed it for parse, etc - in other words just reduced the number of warnings that would be thrown up and its fine now


Advertisement