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 Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/ 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" Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/#findComment-943547 Share on other sites More sharing options...
JamesThePanda Posted October 24, 2009 Author Share Posted October 24, 2009 DOH!!!! Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/#findComment-943549 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 Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/#findComment-943552 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 Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/#findComment-943570 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 Link to comment https://forums.phpfreaks.com/topic/178852-solved-login-page-error/#findComment-943774 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.