JamesThePanda Posted October 24, 2009 Share Posted October 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
cbolson Posted October 24, 2009 Share Posted October 24, 2009 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" Quote Link to comment Share on other sites More sharing options...
JamesThePanda Posted October 24, 2009 Author Share Posted October 24, 2009 DOH!!!! Quote Link to comment Share on other sites More sharing options...
JamesThePanda Posted October 24, 2009 Author Share Posted October 24, 2009 ok now Im getting this error I running wamp I dont know what the password or the username for the data base Quote Link to comment Share on other sites More sharing options...
cbolson Posted October 24, 2009 Share Posted October 24, 2009 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 Quote Link to comment Share on other sites More sharing options...
JamesThePanda Posted October 25, 2009 Author Share Posted October 25, 2009 Ok thanks for ya help man Tha orginal error is solved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.