I always move the code to the bottom of the thread so that new people who try to help just look at it and say something someone else already did - just "so ya know"
I'm really stumped by this one - i just can't figure out what it is!
Here's signin.php
PHP Code:
<?php
//signin.php
include("head.html"); ?>
</center></font>[/b]
<font size="3" color="red">
<?php
$error = $_GET['error'];
$signin = $_GET['signup'];
if ($error == invalid){
echo 'Invalid password/username combination';
}
if ($error == sessionerror){
echo 'You are not authorized to view this information or your login information is not valid - Please try again';
}
if ($signin == true){
echo 'Congratulations! You have successfully signed up!';
}
?>
</font>[b]<font size="4"><center>
Sign-in
<?php include("../../font.html"); ?>
Type in your login information. If you do not yet have an account, please [url="signup.php"]request an invite[/url].
<form method="POST" action="process.php">
Username:
<input type="text" name="username" size="25" maxlength="20">
Password:
<input type="password" name="password" size="25" maxlength="20">
<input type="submit" value="Sign In" name="submit"></p>
</form>
<?php include("foot.html"); ?>
PHP Code:
<?php
//auth.php
$username = $_COOKIE['user'];
$password = $_COOKIE['pass'];
if(empty($username) || empty($password)){
header('Location: ../signin.php?error=sessionerror');
}
//connect to mysql
$hsmemberdb = mysql_connect("**SERVER**", "**USERNAME**", "**PASSWORD**") or die(mysql_error());
mysql_select_db("**DATABASE**") or die(mysql_error());
$query = "SELECT * FROM hsmemberdb WHERE username = '$username' and ********* = '$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 1) {
header('Location: h**p://www.google.com'); //edited this url because it was putting the <a> tag around it
exit();
}else{
header('Location: ../signin.php?error=invalid');
}
?>
PHP Code:
<?php
//index.php
include('auth.php'); //THIS IS THE FILE FROM ABOVE
include('head.php');
//testing - to make sure the cookies were working
echo 'hello ' .$_COOKIE['user'];
echo '
you have '.$_COOKIE['invitekeys'].' invites left';
echo '
you have shared '.$_COOKIE['shared'].' files';
echo '
you have downloaded '.$_COOKIE['downloaded'].' files';
?>