Jump to content

[SOLVED] trying to develop a user logon and registration page.......


cluce

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.