runnerjp Posted December 6, 2006 Share Posted December 6, 2006 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> </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 submittedcould 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 More sharing options...
runnerjp Posted December 6, 2006 Author Share Posted December 6, 2006 [code]$remoteip = getenv("REMOTE_ADDR");$cookies = $HTTP_COOKIE_VARS["ProfileDev"];if ($cookies) {list($login, $password) = explode("&&", $cookies);}[/code]if i use these cookies could i set up login anywhere???? Link to comment https://forums.phpfreaks.com/topic/29651-login-forms/#findComment-136100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.