Results 1 to 3 of 3

Thread: Php problem

  1. #1
    Join Date
    Feb 2013

    Php problem

    Hi ,I got a problem , I try to input the username and password into database,but I got those problem

    ( ! ) Notice: Undefined variable: register in D:\PHPlearn\Assignment3\index.php on line 68

    ( ! ) Notice: Undefined index: in D:\PHPlearn\Assignment3\index.php on line 68

    <input type="submit" name="login" value="Login">
    <input type="submit" name="register" value="register">


    mysql_select_db("assignment3" , $connect);
    mysql_query("INSERT INTO ass3_info (name,password)
    VALUES ('".$username."','".$pwd."')");



  2. #2
    Join Date
    Aug 2012
    Firslty, when accessing post variables, you do not use $ in the variable name

    PHP Code:
    Should be
    PHP Code:
    I would also change your if statement to this

    PHP Code:
    if(isset($_POST['register']) && !empty($_POST['register']) { 
    I don't know what your second error means as it doesn't give the name of the undefined index.

  3. #3
    Join Date
    Oct 2010
    The second error is caused by the first. PHP doesn't find a definition for a $register variable, so it gives an error and evaluates it to NULL. It then tries to evaluate $_POST[NULL] and throws the second error.
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles