kellz Posted November 10, 2007 Share Posted November 10, 2007 I just don't know where the error is, I tried for AGES and deleted lines until i found the error but I still couldn't find it.. ??? <?php if (isset($_POST['Submit'])) login(); function login() { $logged=false; if (isset($_POST['user']) && isset($_POST['pass'])) { $con = mysql_connect("localhost","root",""); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("people", $con); $sql = "SELECT loginName FROM Member WHERE loginName='$_POST[user]' AND password=('$_POST[pass]')"; $result = mysql_query($sql) or die("Couldn't execute query 2."); $num = mysql_num_rows($result); if ($num > 0) { $logged=true; } if ($logged != false) $_SESSION['auth'] = "yes"; } echo $_SESSION['auth']; ?> there's an error on line 42 (ofcourse it isnt on line 42) so there must be an error above that somewhere... edit: OK never mind i fixed it, i forgot a "}" lol but now i get "unknown index auth" ??? edit2: ok i fixed that aswell lol... I should open my eyes! Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/ Share on other sites More sharing options...
kellz Posted November 10, 2007 Author Share Posted November 10, 2007 errrr NOW there is an error i cant fix! and i guess it's the sql (something I'm useless at) even when I enter the correct username and password it doesn't say "logged in" I don't know why... Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/#findComment-388592 Share on other sites More sharing options...
kopytko Posted November 10, 2007 Share Posted November 10, 2007 If your passwords are md5 encoded, try this: <?php $sql = "SELECT loginName FROM Member WHERE loginName='".$_POST['user']."' AND password='".md5($_POST['pass'])."'"; ?> If not, just remove md5 function. Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/#findComment-388674 Share on other sites More sharing options...
Barand Posted November 11, 2007 Share Posted November 11, 2007 Have you called "session_start()" anywhere on that page? Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/#findComment-389415 Share on other sites More sharing options...
kellz Posted November 11, 2007 Author Share Posted November 11, 2007 It's ok, i fixed it ages ago^^ i cant remember what the problem was but thanks anyway Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/#findComment-389448 Share on other sites More sharing options...
Barand Posted November 11, 2007 Share Posted November 11, 2007 No, it's not OK! See the TOPIC SOLVED button? Use it. Link to comment https://forums.phpfreaks.com/topic/76749-solved-login-errors-from-helll/#findComment-389451 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.