Jump to content

login forms


runnerjp

Recommended Posts

ok guys i have a login form on a different page so it logs everything in on that page (folder)

what i want to do is get people to log in on my homepage as well so think i can link my forum blogs and other pages with same loggin system..with me so far.

below is the login form i have so far

[code]<form action="login.php" method="POST">
<table align="center" cellpadding="4" cellspacing="0" class="login_tbl">
    <tr>
        <td class="login_cell">
            <p>Username</p>
        </td>
        <td class="login_cell">
            <p><input type="text" name="login" maxlength="20" size="10" style="font-family:Arial,sans-serif; font-size:9pt;"></p>
        </td>
    </tr>
    <tr>
        <td class="login_cell">
            <p>Password</p>
        </td>
        <td class="login_cell">
            <p><input type="password" name="password" maxlength="20" size="10" style="font-family:Arial,sans-serif; font-size:9pt;"></p>
        </td>
    </tr>
    <tr>
        <td class="login_cell">
            <p>&nbsp;</p>
        </td>
        <td class="login_cell">
            <p><input type="submit" value="Login!" style="font-family:Arial,sans-serif; font-size:9pt;"></p>
        </td>
    </tr>
</table>
</form>[/code]

obviusly this is the login form itself

[code]<?
// File ID: login.php (user log in routine)

include("require/config.php");
require("$reqpath/membership.php");

$content="$incpath/loginbox.inc.php";
$menu="$incpath/menu_u.inc.php";
$page_title="Login Form";

if ($HTTP_POST_VARS) {
  if ($login && $password) {
$password=crypt($password, $login);
$data=authenticate($login, $password);
if ($data[error]) {$error=$data[error];}
else {
setcookie("ProfilePages","$login&&$password", 0, "/");
if (!$ref) {$ref="index.php";}
Header("Location: redirect.php?ref=$ref");
}
  } else {$error="901";}
}

error_message($error);


?>[/code]

and this is what happens to the form when submitted

could i just put the form on each page but change the login action to the folder which the login script is in?? and also would this mean that the person will be loged in all time untill they choose to log out???
Link to comment
https://forums.phpfreaks.com/topic/29651-login-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.