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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.