Quote
Warning: Cannot modify header information - headers already sent by (output started at /home/cory/domains/gamingreloaded.com/public_html/zp/member system/config.php:1) in /home/cory/domains/gamingreloaded.com/public_html/zp/member system/login.php on line 27
then when i go to member.php page, i can get it, then when i log out, and try to get to the member page, it takes me back to the login page (which is right) but i cant get it to go to the member page after i click on login
heres the login page code:
<?php
session_start();
include 'config.php';
if(isset($_POST['login']))
{
$username = trim(addslashes($_POST['username']));
$password = md5(trim($_POST['password']));
$query = mysql_query("SELECT * FROM Users WHERE Username = '$username' AND Password = '$password' LIMIT 1") or die(mysql_error());
$row = mysql_fetch_array($query);
// now we check if they are activated
if(mysql_num_rows($query) > 0)
{
if($row['Activated'] > 0)
{
$_SESSION['s_logged_n'] = 'true';
$_SESSION['s_username'] = $username;
$_SESSION['s_name'] = $row['Name'];
header('Location: member.php');
} else {
echo '
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="error"><p>Sorry, you must activate your account first. Please check your email for the email.</p>
<p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p></div>
</body>
</html>
';
}
} else {
echo '
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="error"><p>There was an error processing your login, it appears that your username and/or password was incorrect. Please try again.</p>
<p>Didn'."'".'t get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
</div>
</body>
</html>
';
}
} else {
?>
<html>
<head>
<title>Login</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="head">the login page</div><br>
<div id="main">
<p>You must login to view this page. Enter your username and password below and hit submit:</p>
<form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<p>Username:<br>
<input name="username" type="text" class="textBox" id="username">
<p>Password:<br>
<input name="password" type="password" class="textBox" id="password">
</p>
<p>
<input name="login" type="submit" class="textBox" id="member" value="Submit">
</p>
</form>
<p>Didn't get your validation email? <a href="resend.php">Click here</a> to resend the validation email.</p>
<p>Need an account? <a href="register.php">Click here</a> to register, it's completely free! </p>
</div>
</div>
</body>
</html>
<? } mysql_close($l); ?>
I need some help please!
edit: line 27 is this:
header('Location: member.php');
Edited by venomsnake, 04 October 2005 - 06:08 PM.
