cluce Posted April 27, 2007 Share Posted April 27, 2007 04/27/2007 07:00:41 PM here is the code I am using.. <?php require_once('Connections/COnn2.php'); ?> <?php // *** Validate request to login to this site. $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['firstname'])) { $loginUsername=$_POST['firstname']; $password=$_POST['lastname']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "User_login.html"; $MM_redirectLoginFailed = "registration.html"; $MM_redirecttoReferrer = false; mysql_select_db($database_COnn2, $COnn2); $LoginRS__query=sprintf("SELECT id, f_name FROM auth_users WHERE id='%s' AND f_name='%s'", get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $COnn2) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?> logon on with user name and password still brings me to the registration page. can someone give me any suggestions. I did delete this code at the top because I was recieving crazy messages......... if (!isset($_SESSION)) { session_start(); } ....the error messages I was getting was ..... Warning: open(/tmp\sess_df7e67aa92cb740cee4bce1b9ac58406, O_RDWR) failed: No such file or directory (2) in c:\phpdev5\www\user_logon.php on line 5 Warning: open(/tmp\sess_df7e67aa92cb740cee4bce1b9ac58406, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0 when I deleted those two lines I can atleast get to the registration page but it does the same thing when I use a logon and password. its like its not retrieving and storing the data to access that page. can someone help me with this? I would really appreciate it. Link to comment https://forums.phpfreaks.com/topic/48973-solved-trying-to-develop-a-user-logon-and-registration-page/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.