View Single Post
  #8  
Old 15th August 2011, 20:15
new new is offline
Junior Member
 
Join Date: Aug 2011
Posts: 4
Thanks: 4
Thanked 0 Times in 0 Posts
Default encrypt function in registration form

Thanks Falko.

There is a "SELECT" function from DB table.. with which I have no problem.

The deal is in my PHP registration FORM, whre I have to "INSERT" ENCRYPT password.

Eg. register.php
PHP Code:
<form id="register" name="register" method="post" action="exec.php" class="new.user">

[.....]

<
label>Username</label>
<
input name="uname" type="text" class="textfield" id="uname" />
<
input type="hidden" name="site" value="@my.site.com"  id="site"  maxlength="128" />
 <
br />

<
label>Password</label>
<
input name="password" type="password" class="textfield" id="password" />

<
label>Confirm Password</label>
<
input name="cpassword" type="password" class="textfield" id="cpassword" />

[....] 
exec.php

PHP Code:
[....]

$Umail $_POST['uname'].'/'.$_POST['site'];


    
$qry "INSERT INTO users(email, password, ..., ...) VALUES('$Umail','" xxxxxxxxxxxxxxx ($_POST['password'])."','...', '...')";
    
$result = @mysql_query($qry);

[....] 
Kalko... the whole process works perfect, but where the xxxxxxxxxx are .. is the part where I do not know what to put, in order to make "INSERT" the password by ENCRYPT.

Remenber that from your tutorial, we do INSERT these values from MYSQL terminal using:
PHP Code:
INSERT INTO users(emailpassword, ..., ...) VALUES('$Umail','" ENCRYPT($_POST['password_here'])."','...''...')"; 
But I need to let users do it from my php registration form.

Regards

Last edited by new; 15th August 2011 at 20:18.
Reply With Quote