Hi, I have a quick question!
I’m working on a page which you must be logged in to view, but I was it so if you are not logged in the login form shows, and once you login, it redirects you back to the page you were at rather than the index page… Here’s the code I have written so far:
[php]<?php
require “header.php”
?>
<?php
if($userdata[‘session_logged_in’])
{
echo(‘You are logged in!’);
}
else
{
?>
You are not logged in!<br />
<form action="<?php echo($phpbb_root_path); ?>login.php" method="post" enctype="multipart/form-data">
Username: <input type="text" name="username"><br />
Password: <input type="password" name="password"><br />
<input type="hidden" name="redirect" value="../">
<input type="submit" value="login" name="login">
</form>
<?php
}
?>[/php]
Now in the redirect value, it redirects me to the index.php page, but I want it to redirect me to the page I was at that I had to be logged in to view, I’m trying to make it as a template so one can use this code for numerous pages without needed to edit the php values… is this possible, or will I have to do it manually…any solutions??
Thanks