coldfiretech Posted August 20, 2008 Author Share Posted August 20, 2008 Changed that. Getting this though Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\cellsavior\userAuth.php on line 10 Link to comment https://forums.phpfreaks.com/topic/120466-solved-need-guru-help-php-login-not-working/page/2/#findComment-620844 Share on other sites More sharing options...
cooldude832 Posted August 20, 2008 Share Posted August 20, 2008 do u have php error reporting on??? try <?php $db_host = 'localhost'; $db_user = '****'; $db_pass = '****'; $db_db = '*****'; $con = mysql_connect($db_host, $db_user, $db_pass) or die('MySQl Connection Error:'.mysql_error()); mysql_select_db($db_db, $con) or die('MySQL Error: Cannot select table'); $user = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); $q = " SELECT login, subtype FROM `users` Where login = '".$user."' AND password = '".$password."' "; $r = mysql_query($q,$con) or die(mysql_error()."<br /><br />".$q); if(mysql_num_rows($r) >0){ $row = mysql_fetch_assoc($r); switch ($row['subtype']){ case "single": die(header("location: /****/single.php")); break; case "partner": die(header("location: /****/partner.php")); break; case "family": die(header("location: /***/family.php")); break; default: die(header("location: index.html?msg=invalid subtype")); } } else{ die(header("location: index.html?msg=invalid login")); } mysql_close ($con); ?> Link to comment https://forums.phpfreaks.com/topic/120466-solved-need-guru-help-php-login-not-working/page/2/#findComment-620845 Share on other sites More sharing options...
coldfiretech Posted August 20, 2008 Author Share Posted August 20, 2008 THANK YOU!@~!!!!!!!!!!!!! [bows down] I appreciate all of everyones help.. Sorry for being a grump! Link to comment https://forums.phpfreaks.com/topic/120466-solved-need-guru-help-php-login-not-working/page/2/#findComment-620846 Share on other sites More sharing options...
cooldude832 Posted August 20, 2008 Share Posted August 20, 2008 you have another problem you aren't authenticating the user any where (sessions or cookies) so look at some basic login tutorials and see how to make it better. Link to comment https://forums.phpfreaks.com/topic/120466-solved-need-guru-help-php-login-not-working/page/2/#findComment-620859 Share on other sites More sharing options...
Third_Degree Posted August 23, 2008 Share Posted August 23, 2008 At third degree: ppl shouldn't be able to turn it off its very helpful it's annoying though. Link to comment https://forums.phpfreaks.com/topic/120466-solved-need-guru-help-php-login-not-working/page/2/#findComment-623657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.