Jump to content

[SOLVED] Login Page Error


JamesThePanda

Recommended Posts

Hi

I am making a login script.

I keep getting a parse error on line 12

 

<?php
$host = "localhost";
$username = "";
$password = "";
$db_name= "members";
$tbl_name= "memtable";

mysql_connect ($host,$username,$password) or die ("Cant connect to database");
mysql_select_db ($db_name) or die (mysql_error());

$myusername = $_POST['myusername']
$mypassword = $_POST['mypassword']

$sql = "SELECT * FROM $tbl_name WHERE username ='$myusername' AND password = '$mypassword'" ;

$result = mysql_query ($sql);

$count = mysql_num_rows ($result);

if ($count == 1){
session_register("username");
session_register("password");
header("location:login-success.php");
}
else {
echo "Wrong Username or password"
}
?>

Can any one see what the problem is?

 

Thanks

 

James

Link to comment
https://forums.phpfreaks.com/topic/178852-solved-login-page-error/
Share on other sites

Hi,

you are missing the closing ";" at the end of these lines:

 

$myusername = $_POST['myusername']

$mypassword = $_POST['mypassword']

 

Chris

 

EDIT - you are also missing one at the end of this line further down:

 

echo "Wrong Username or password"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.