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
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"

Link to comment
Share on other sites

well, can't answer that one for you :(

If it is on wamp I presume that means that you created the database so therefore you should have the ability to go in and modify the settings, don't you?

I'm afraid that servers is not my area. sorry :(

 

Chris

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.