this is what i have:-
Code:
<?
//set the cookie on this page and then go to logact.php
//echo "username = $username<br>";
$username = @$HTTP_POST_VARS["username"];
$password_temp = @$HTTP_POST_VARS["password"];
$password = md5($password_temp);
$intheform = @$HTTP_POST_VARS["intheform"];
IF (($username == "") AND ($password == "") AND ($intheform == "yes")):
$error = "Please enter your username & password";
ELSE:
// echo "came through 1 - contains 1 complete field<br>";
IF (($username != "") && ($password != "")):
// echo "came through 2 - both fields complete<br>";
require "_inc/connect.php";
$query = "SELECT username, password FROM users WHERE username='$username'";
$result = @MYSQL_QUERY($query) OR DIE ("Failed to $query on line 5");
$num = MYSQL_NUMROWS($result);
IF ($num > 0):
// echo "came through 3 - found a user<br>";
$sqlpassword = MYSQL_RESULT($result,0,password);
IF ($sqlpassword == $password):
// echo "came through 4 - user pwd match with db pwd<br>";
setcookie("login",$username,0);
echo "<SCRIPT>";
echo "window.location = \"user\"</SCRIPT>";
ELSE:
$error = "Incorrect Password. Please try again.";
ENDIF;
ELSE:
$error = "Username does not exist. Please try again.";
ENDIF;
ELSEIF (($username != "") || ($password != "")):
$error = "Please complete the form before submitting.";
ENDIF;
ENDIF;
?>
All that does it check the username and password but does not forward to the folder associated with that user in the database.
The fields for the database are:-
Username
Password (MD5)
Folder
What i need it to do is once it has checked the username and password i need it to forward to there own folder and prevent access to other peoples folders.