<?php

// Display Errors
		error_reporting(E_ALL); 



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


if ($username&&$password&&$adminid)
{

$connect = mysql_connect("localhost", "usernamehere", "passwordhere") or die("Error connecting to Database. Please notify an administrator.");
mysql_select_db("databaase_ishere") or die("DB not found");

	$query = mysql_query("SELECT * FROM usersauto WHERE username='$username'");

	$numrows = mysql_num_rows($query);

	if ($numrows!=0)
	{
		// code to log in
		while ($row = mysql_fetch_assoc($query))

		{
					$dbusername = $row['username'];
					$dbpassword = $row['password'];
					$dbadminid = $row['adminid'];
		}

			// check to see if they match
			if ($username==$dbusername&&$password==$dbpassword&&$adminid==$dbadminid)
				{
					echo "You have been successfully logged in!";
				}
					else
						echo "Incorrect password!";

	}
		else
			die("User does not exist in the database.")
}
[B]?>[/B]

I am getting the error from Aurora (really new Firefox Beta) that is:

Parse error: syntax error, unexpected $end in public_html/SandboxItems/login.php on line 46

Line 46 is in bold.

Any help would be greatly appreciated, as I am quite new to PHP coding.

    Welcome to PHPBuilder! In the future, note that there is a stickied thread in the Coding forum called Parse error: syntax error; please post any parse error issues in that thread rather than creating a new one. You might also want to browse through that thread as well; there are a very short list of common problems that probably cover around 90&#37; of the parse error questions posted.

    As for your issue, I get a different error message:

    Parse error: syntax error, unexpected '}' ... on line 45

    which is caused by a missing semicolon after the preceding die() statement.

      Sorry about missing that forum. I based my placing off of another google search.

      Okay, semicolon can be fixed. But I don't understand the problem with 46. I am close to getting that darned login script to run. I dunno what I would do without google.

        After adding the semicolon on line #46, there are no more parse errors in the code snippet you posted.

          Write a Reply...