what does this error >> PHP Notice: Use of undefined constant submit,means??[help!!]

Discussion in 'PHP' started by qistina-87, May 6, 2007.

  1. #1
    i am inserting data from the user input into the database. the database that i am using is ms sql. but i got an error which i dont understand. this is the error >>>> PHP Notice: Use of undefined constant submit - assumed 'submit' in C:\Inetpub\wwwroot\VisitorSurvey.php on line 38.

    what does this error mean? n how can i solve this error problem?
     
    qistina-87, May 6, 2007 IP
  2. chilli_source

    chilli_source Active Member

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    61
    #2
    its hard to say without seeing the code around the lines that the error is reporting..
     
    chilli_source, May 6, 2007 IP
  3. legend2

    legend2 Well-Known Member

    Messages:
    1,537
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    115
    #3
    you're using an undefined constant, as simple as that.
    either define() it or check if you're missing a $ behind a variable, making the interpreter think it is a constant.
     
    legend2, May 7, 2007 IP
  4. rodney88

    rodney88 Guest

    Messages:
    480
    Likes Received:
    37
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As above - although additionally if you're accessing an associative array using a key, this needs to be in quotes. I.e. rather than $_POST[submit] you must use $_POST['submit'].
     
    rodney88, May 7, 2007 IP
  5. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, rodney88's on the right track... I would guess it's an unquoted string somewhere that is then assumed to be a constant which is undefined.
     
    TwistMyArm, May 7, 2007 IP