ok this is the code, i cant find anything wrong, but it got to be something wrong.
and i think that the problem start here??? at this point...(login.php)
if you want to take a look at the current web page this is the link
Click me !!! (sign up if you want to test it. there is nothing on the site only the join script. also the layout is not finished at all.(is not even started)
------------------------This is login.php----------------------------------
<?
include("include/config.php");
$auth = false;
if (isset( $auth_user ) && isset($auth_pw)) {
include("$root/config.php");
$errormsg = "Incorrect username or password";
$auth_pw = md5($auth_pw);
mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($db_database);
$sql = "SELECT * FROM $db_table WHERE
username = '$auth_user' AND
password = '$auth_pw'";
$result = mysql_query( $sql )
or die ( 'Unable to execute query.' );
// Get number of rows in $result.
$num = mysql_numrows( $result );
if ( $num != 0 ) {
// vars found in db, auth=true:
$auth = true;
}
}
if ( ! $auth ) {
// the invalid login stuff:
require("$root/account.inc");
// making title and header:
make_header("umbrella users, Login");
// the login page:
include("$root/account_login.inc");
// making footertje:
make_footer();
exit;
} else {
$username = $auth_user;
$ccontent = "$auth_user:$auth_pw";
setcookie ("authacc", "$ccontent");
}
?>
<?
require("$root/account.inc");
// making header and title:
make_header("umbrella users, Login");
?>
<?
echo "
<div align=\"center\">
<font size=\"5\" face=\"Tahoma\">
succesfully logged in!<BR>
<a href=\"$domain/members/member.php\">click here</a> to continue
</font></div>
";
?>
<?
// making footer
make_footer();
?>
------------------------This is members.php----------------------------------
<?
include("../include/account.php");
?>
<html>
<head>
</head>
<body>
<p>Welcome <b><?php echo $gotuser ?></b> to your account.
<?
echo "
<p>click Here To <a href=\"../logout.php\">logout</a></p>
";
?>
<?
// making the footer:
make_footer();
?>
</body>
</html>
------------------------This is account.php----------------------------------
<?php
$auth = false;
if (isset($HTTP_COOKIE_VARS["authacc"])) {
$twovar = $HTTP_COOKIE_VARS["authacc"];
list($gotuser,$gotpass) = explode(":",$twovar);
mysql_connect($db_host, $db_user, $db_passwd);
mysql_select_db($db_database);
$sql = "SELECT * FROM $db_table WHERE
username = '$gotuser' AND
password = '$gotpass'";
$result = mysql_query( $sql )
or die ( 'Unable to execute query.' );
// Get number of rows in $result.
$num = mysql_numrows( $result );
if ( $num != 0 ) {
// vars found in db, auth=true:
$auth = true;
}
if ( ! $auth ) {
// message when cookie is cheated:
echo 'Invalid cookie!';
exit;
}
} else {
// the stuff that happens when cookie is not set:
//requiring the layout file:
require("$root/account.inc");
// this makes the header, and fills up the header title
make_header("umbrella users");
// short login message
echo "Please <a href=\"$domain/login.php\">login</a>";
// making the footer:
make_footer();
exit;
}
?>
<?
require("$root/account.inc");
// this makes the header, and fills up the header title
make_header("Welcome $gotuser");
?>
<?
// making the footer:
make_footer();
?>