Jump to content

[SOLVED] login.. errors from helll


kellz

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.