02-01-2008, 04:54 PM
|
#1 (permalink)
|
|
The Prestige
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
|
Problem xD
Why doesn't this work?
PHP Code:
if(!isset($uid)) { $_SESSION['error'] = '<font color="red">We couldn\'t find a user using those login details!</font>'; if(isset($_SESSION['error'])) { header("Location: account.php?act=login"); } else { echo 'Could not set session'; } } else { $tanaxia['user']->user_login($uid); }
And then this in my loginform:
PHP Code:
$tanaxia['template']->loadfile('loginform'); $msg = $_SESSION['error']; $tanaxia['template']->parse( array( 'error' => array( 'msg' => $msg ) ));
And this is loginform.tpl
Code:
<h1>Login</h1>
<form action="account.php?act=login" method="post">
<h3>Username:</h3>
<input type="text" name="user" /><br />
<h3>Password:</h3>
<input type="password" name="pass" /><br /><br />
<input type="submit" name="login" value="Login" />
</form>
{error.msg}
I logged in with the wrong details just to test the error msg..
But it didn't work =//
The error msg didn't show.. it just redirected me to the loginform again..
Any ideas? :S
|
|
|
|