Using Dreamweaver MX, Iam attempting to create a login page/register page in PHP, its adding users to the mysql database, but when i add a username that already exists its supposed to divert to another page called taken.php, & also an error page when the login fails,however its still taking me to the welcome page ! whatever i do ? any thoughts ?

the login page comes back with various errors too, am i missing some important values ? the code for the login is below...

this is my first attempt, be kind !

this is the error i get back from the login.php page,

Warning: open(/tmp\sess_61267ce9f0e04fa7dcd729aaad604a4c, O_RDWR) failed: m (2) in C:\apache\htdocs\login.php on line 4


Warning: open(/tmp\sess_61267ce9f0e04fa7dcd729aaad604a4c, O_RDWR) failed: m (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

Cheers !!



<?php require_once('Connections/log.php'); ?>
// *** Start the session
// *** Validate request to log in to this site.
if (isset($HTTP_POST_VARS['username'])) {
$FF_rsUser_Source="SELECT ID, username ";
if ($FF_fldUserAuthorization != "" ) $FF_rsUser_Source .= "," . $FF_fldUserAuthorization;
$FF_rsUser_Source .= " FROM users WHERE ID='" . $FF_valUsername . "' AND username='" . $FF_valPassword . "'";
mysql_select_db($database_log, $log);
$FF_rsUser=mysql_query($FF_rsUser_Source, $log) or die(mysql_error());
$row_FF_rsUser = mysql_fetch_assoc($FF_rsUser);
if(mysql_num_rows($FF_rsUser) > 0) {
// username and password match - this is a valid user
session_register("MM_Username" );
if ($FF_fldUserAuthorization != "" ) {
} else {
session_register("MM_UserAuthorization" );
if (isset($accessdenied) && false) {
$FF_redirectLoginSuccess = $accessdenied;
session_register("FF_login_failed" );
$FF_login_failed = false;
header ("Location: $FF_redirectLoginSuccess" );
session_register("FF_login_failed" );
$FF_login_failed = true;
header ("Location: $FF_redirectLoginFailed" );
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<form name="form1" method="POST" action="<?php echo $FF_LoginAction?>">

<table width="80%" cellspacing="0" cellpadding="0">
<td width="11%">Username/td>
<td width="89%">
<input name="username" type="text" id="username"></td>
<input name="password" type="password" id="password">
<input type="submit" name="Submit" value="Log in"></td>
Last edited by rikmg