Search the Community
Showing results for tags 'login form'.
-
Hi Everyone, I have a couple of questions to ask as I am a PhP newbie. Firstly I am working on a website which will have some content inside it which I only want members to view: as far as I am aware I need to write:- i) Registration script ii) Log-in script which will both work with a MySQL database which will store the members login details. (So far so good I think!!!!) is there access to forms that have already been written?? and have I got the procedure above correct for a membership style website... is there anything else I should be aware of ?? basic questions I know but I really am new to this...
- 5 replies
-
- membership forms
- login form
-
(and 2 more)
Tagged with:
-
help any password logs in on my website.help with validation using acct num and password. my codes. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['Account_Number'])) { $loginUsername=$_POST['Account_Number']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "account_" .$account[0] .".php"; $MM_redirectLoginFailed = "login failed.html"; $MM_redirecttoReferrer = false; mysql_select_db($database_cthey_reg, $cthey_reg); $LoginRS__query=sprintf("SELECT `Account Number`, password FROM login WHERE `Account Number`=%s AND password=%s", GetSQLValueString($loginUsername, "-1"), GetSQLValueString($password, "text")); $LoginRS = mysql_query($LoginRS__query, $cthey_reg) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();} //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; }else{ $account = mysql_fetch_array($LoginRS); $MM_redirectLoginSuccess = "account_".$account[0] .".php"; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?>