Hi,
I thought i'd give sessions a go but which i hadn't now 🙁 Anyway, i keep getting the error message:
Cannot send session cache limiter
I've read loads of posts with the same problem but the solution (to put session_start()😉 at the top, before any html isn't working..here an example of my code:
index.php
<?php
session_start();
?>
<html>
<head>
</head>
<body>
<form method="post" action="login.php">
Username <input type="text" name="username"><br>
Password <input type="password" name="password"><br>
<input type="submit" value="submit">
</form>
</body>
</html>
---------------
login.php
<?
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
$db = mysql_connect("localhost","username","password");
mysql_select_db("database",$db);
$query = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$login_check = mysql_num_rows($query);
if($login_check > 0)
{
while($user = mysql_fetch_array($query))
{
$today = date("l jS F");
mysql_query("UPDATE users SET last_login='$today' WHERE username='$username'");
session_register('member_id');
$_SESSION[user] = $user['member_id'];
echo $_SESSION[user];
}
}
else
{
echo "Poopy password";
}
?>
But as soon as i use session_register() I get the error! can anyone help me?
Please pardon my inability to figure this one out myself, I use this forum as a last resort before tearing my hair out.
Thanks
Ant