1 (edited by Ndogg 2009-07-24 10:30)

Topic: Login Page

My site also has a main page, so I was wondering if anyone could help me with adding a login page to my main page so that the site and forums are connected. Iv been messing around with this forever and nothing works. Please help me as soon as possible.


Im using this code, but it doesnt keep you logged in, what do I need to add to this in order to make it a real login form?

<?php
 
// Define the path to the forum root
define('FORUM_ROOT', '');
require FORUM_ROOT.'include/common.php';
 
// Where will we go after login?
$forum_page['redirect_url'] = 'http://graphicdesign.netii.net/Home/site/Banner-List..php';
 
$forum_page['form_action'] = forum_link($forum_url['login']);
 
$forum_page['hidden_fields'] = array(
    'form_sent'        => '<input type="hidden" name="form_sent" value="1" />',
    'redirect_url'    => '<input type="hidden" name="redirect_url" value="'.forum_htmlencode($forum_page['redirect_url']).'" />',
    'csrf_token'    => '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />'
);
 
?>
<form method="post" action="<?php echo $forum_page['form_action'] ?>">
    <?php echo implode("\n\t\t", $forum_page['hidden_fields'])."\n" ?>
 
    Username:
    <input type="text" id="fld1" name="req_username" value="" />
    <br />
 
    Password:
    <input type="password" id="fld2" name="req_password" value="" />
    <br />
 
    <input type="checkbox" id="fld3" name="save_pass" value="1" />
    <label for="fld3">Log me in automatically each time I visit.</label>
    <br />
 
    <input type="submit" name="login" value="Login" />
</form>

Re: Login Page

You should write the function, that keep you logged in.
The code, which you perform, is only the web page appearance.