Encryption problem
Hi,
I wonder if anyone can help me out here.
I'm just constructing a form that registers people for a newsletter. It's a double opt in form that I'm cobbling together from various places.
I've got to the stage where I want to insert the info into an database. In other places on the site the password is encrypted using security assist. In this case the insert into database part is written like this:
$sql = "INSERT INTO bbc_people
(firstname,
lastname,
userLevel,
realmail,
confirmed,
username,
encpwd,
lastUpdated) VALUES (
'" . $_POST['firstname'] . "',
'" . $_POST['lastname'] . "',
'" . $_POST['userLevel'] . "',
'" . $_POST['realmail'] . "',
0,
'" . $_POST['username'] . "',
'" . $_POST['encpwd'] . "',
NOW())";
The "encpwd" is the password field. I assume I have to add to the page:
<?php require_once( "../../WA_SecurityAssist/Helper_PHP.php" ); ?>
And also add somewhere:
.WA_SHA1Encryption
I've tried:
'".WA_SHA1Encryption . $_POST['encpwd'] . "',
But without success.
Am I up a gumtree? Or is there a way to do this without reinventing the entire wheel?
I really appreciate any help anyone can offer.
Many thanks.