chanfuterboy Posted November 6, 2009 Share Posted November 6, 2009 hi, I just cant see what im dont wrong, someone can help me, i have the username and pasw field in other page when enter in redirect to login.php so something is not good in the script, but what i dont know i just see the page goes cant open it pls help me out <?php session_start(); include ('dbconfig.php'); $username= $_POST['username']; $password= $_POST['password']; if ($username&&$password) { $query= mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0) ( while($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } // chek ) else die(" e username no ta eksisti"); } else die("Please hinka un username of pasw"); ?> Link to comment https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/ Share on other sites More sharing options...
mrMarcus Posted November 6, 2009 Share Posted November 6, 2009 you're using round brackets instead of curly braces: if ($numrows!=0) ( replace the ( with { and do the same for the closing ) -> } Link to comment https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/#findComment-952609 Share on other sites More sharing options...
chanfuterboy Posted November 6, 2009 Author Share Posted November 6, 2009 hi, thanks im still busy on it, the } and ( seems to small in editor so i can not picup the error Link to comment https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/#findComment-952616 Share on other sites More sharing options...
jonsjava Posted November 6, 2009 Share Posted November 6, 2009 I cleaned up the code so syntactically, it's correct. <?php session_start(); include ('dbconfig.php'); $username= $_POST['username']; $password= $_POST['password']; if ($username&&$password){ $query= mysql_query("SELECT * FROM users WHERE username='$username'"); $numrows = mysql_num_rows($query); if ($numrows!=0){ while($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } // chek } else die(" e username no ta eksisti"); } else die("Please hinka un username of pasw"); ?> Link to comment https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/#findComment-952617 Share on other sites More sharing options...
mrMarcus Posted November 6, 2009 Share Posted November 6, 2009 hi, thanks im still busy on it, the } and ( seems to small in editor so i can not picup the error i don't follow .. but i see SOLVED, so that's good. Link to comment https://forums.phpfreaks.com/topic/180564-solved-login-problem-help/#findComment-952627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.