www.webdeveloper.com
Results 1 to 4 of 4

Thread: Parse error: syntax error, unexpected T_ELSE in row 37 HELP!

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Parse error: syntax error, unexpected T_ELSE in row 37 HELP!

    THis is My Code:

    <?php

    include ("config.php");

    if ($_POST ['submit'] )
    {

    $username = $_POST ['username'];
    $password = $_POST ['password'];

    if ($username && $password )
    {

    $query = mysql_query ("SELECT * FROM users");
    while ($getrows = mysql_fetch_assoc ($query))
    {

    $dbuser = $getrows ['username'] ;
    $dbuser = $getrows ['password'];

    }

    if (($username == $dbuser) && ($password == $dbpass))

    {

    echo "Login Successful.." ;

    }
    else

    {

    echo "Login Failure.." ;

    }else{

    die ("The username and passwords fields should not be left empty.");

    }
    }


    ?>

    Any Help?

  2. #2
    Join Date
    Mar 2012
    Location
    Saint-Petersburg, Russia
    Posts
    97
    Do not you see yourself you have two "else" for one "if"? I suppose it is because you forgot closing curly bracket before second "else".

  3. #3
    Join Date
    Aug 2010
    Location
    San Diego
    Posts
    242
    I'd work on indenting your code. It will make things clearer and the error would stand out more.

  4. #4
    Join Date
    Apr 2012
    Posts
    2
    Quote Originally Posted by handcraftedweb View Post
    I'd work on indenting your code. It will make things clearer and the error would stand out more.

    Ty

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