Although PHP classes $Password and $password as 2 seperate variables, I'm
pretty sure when you 'post' the data, it passes them ALL as lowercase.

Call them password1 and password2 and keep all the variables lower case and
see if it works

Let me know

Ross

-----Original Message-----
From: Todd Williamsen [mailto:[EMAIL PROTECTED]]
Sent: 18 November 2001 23:19
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Authentication Scripts


I have been trying to use a script that adds users to the database and this
is what I came up with, which DOES not work for some unknown reason:

I have been having problems with your script, maybe its me, the hosting
provider.. But I need to find out what is what.

I have a DB called feminineforum and I already have a table of users with
all their contact information already in there. It also has their usrnames
and passwords already listed. The table name is tblmembers and here is the
list of the column names:

ID

FirstName

Initial

LastName

Address1

Address2

City State

Zip

HomePhone

WorkPhone

Fax

Email

Userid

Password

Registered

Modified

Modified_By

I modified the table name, DB name and of course the sql statement. I was
just trying to add a user with the following html form:

<html>

<head><title>User Admin Page : Add a User</title></head>

<body bgcolor="#ffffff">

<table bgcolor=#000000 valign=top align=center border=0><tr><td

bgcolor=#000000><table cellpadding=4 bgcolor=#ffffff cellspacing=2 border=0>

<Tr><th>Add a User</th></tr><tr><td>

<FORM METHOD="post" ACTION="add.php">

First Name: <INPUT TYPE=text MAXLENGTH=70 NAME="FirstName" SIZE=20><Br>

Initial: <INPUT TYPE=text MAXLENGTH=70 NAME="Initial" SIZE=20><Br>

Last Name: <INPUT TYPE=text MAXLENGTH=70 NAME="LirstName" SIZE=20><Br>

Address1: <INPUT TYPE=text MAXLENGTH=70 NAME="Address1" SIZE=20><Br>

Address2: <INPUT TYPE=text MAXLENGTH=70 NAME="Address2" SIZE=20><Br>

City: <INPUT TYPE=text MAXLENGTH=70 NAME="City" SIZE=20><Br>

State: <INPUT TYPE=text MAXLENGTH=70 NAME="State" SIZE=20><Br>

Zip Code: <INPUT TYPE=text MAXLENGTH=70 NAME="Zip" SIZE=20><Br>

Home Phone: <INPUT TYPE=text MAXLENGTH=70 NAME="HomePhone" SIZE=20><Br>

Work Phone: <INPUT TYPE=text MAXLENGTH=70 NAME="WorkPhone" SIZE=20><Br>

Fax Number: <INPUT TYPE=text MAXLENGTH=70 NAME="Fax" SIZE=20><Br>

Email Address: <INPUT TYPE=text MAXLENGTH=70 NAME="Email" SIZE=20><Br>

Username: <INPUT TYPE=text MAXLENGTH=70 NAME="UserId" SIZE=20><Br>

Password: <Input Type=text Maxlength=70 Name="Password" Size=10><Br>

Password for modification:<Input Type=password Maxlength=70 Name="password"
Size=20>

<INPUT TYPE=submit VALUE="Add"> <INPUT type=reset VALUE="Reset Form"></form>

</tr></td></table></tr></td></table>

</body>

</html>

>From what I can see the form looks fine... Here is the PHP script for the
add.php:

<?

if($password=="modificationpasswdhere")

{

$ID = uniqid("ID");

$db = mysql_connect("localhost","feminine","krmc33");

mysql_select_db ("feminineforum");

$result = mysql_query ("INSERT INTO tblmembers (ID, FirstName, Initial,
LastName, Address1, Address2, City, State, Zip, HomePhone, WorkPhone, Fax,
Email, UserId, Password)

VALUES ('$ID', '$FirstName', '$Initial', '$LastName', '$Address1',
'$Address2', '$City', '$State', '$Zip', '$HomePhone', '$WorkPhone', '$Fax',
'$Email', '$UserId', '$Password') ");

if(!$result)

{

echo "<b>User not added:</b> ", mysql_error();

exit;

}

if($result)

{

mysql_close($db);

print "User <b>$UserId</b> added sucessfully!";

}

}

else

{

print ("Wrong Password");

}

?>



Now when I go and add a user, I get "Wrong Password" why is it doing that?




--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to