Free2Code
 
Time: 2008-11-21, 07:40am
Oldpassword
Subject: Oldpassword  ·  Posted: 2008-05-06, 07:19am
Rank: ? (1)
Member #: 29755
The tutorial is awsome I learned alot.. been strugglin to learn Mysql for awhile..

Okay I am trying to figure this out... and I get most of it... just havin issues with one little thing..

In the register.php example on http://www.free2code.net/tutorials/view/creating_a_php_login_script-5/page4.html

I am trying to figure out how to make it register the password using the OLD_PASSWORD method

Starting on line 74
}

// now we can add them to the database.
// encrypt password

// $_POST['passwd'] = md5($_POST['passwd']);

if (!get_magic_quotes_gpc()) {
$_POST['passwd'] = addslashes($_POST['passwd']);
$_POST['email'] = addslashes($_POST['email']);
$_POST['website'] = addslashes($_POST['website']);
$_POST['location'] = addslashes($_POST['location']);
}

$regdate = date('m d, Y');

$insert = "INSERT INTO users (
username,
password,
regdate,
email,
website,
location,
show_email,
last_login)
VALUES (
'".$_POST['uname']."',
HERE----> 'OLD_PASSWORD('.$_POST['passwd'].'),
'$regdate',
'".$_POST['email']."',
'".$_POST['website']."',
'".$_POST['location']."',
'".$_POST['show_email']."',
'Never')";

What am I doing wrong?

 
  Reply to this ·  Post link ·  Top
Subject: Re: Oldpassword  ·  Posted: 2008-05-11, 05:45pm
Rank: ? (90)
Member #: 1672
Is this based on Jesters tutorial? If so you can't use OLD_PASSWORD as a word when submitting to the DB.

plus your leaving in 'OLD_PASSWORD('.$_POST['passwd'].')

I dont think this will work even if you took it out, because when you login isnt it decrypting the md5 encrypt method?


Meh!
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons