please help me... my password gets encrypted but not able to get in database


Posted on 16th Feb 2014 07:03 pm by admin

hai guys,
please help me... in the following function my password gets encrypted but not able to get in database.is any error in the query please help me......


Did you know?Explore Trending and Topic pages for more stories like this.
<?php

$email = $_POST['username'];
$oldpass=$_POST['password'];
$newpass=$_POST['newpass'];
$conpass=$_POST['confirmpass'];

$encry_oldpass=md5($oldpass); //encrypting old password


$con = mysql_connect("localhost","root","");
mysql_select_db("content_management",$con);

$result=mysql_query("SELECT * FROM register_data WHERE eMail='".$email."' and password='".$encry_oldpass."' and isValidate=0 and isDelete=0");
$count=mysql_num_rows($result);

if((!empty($newpass)&&!empty($conpass))&&($newpass==$conpass)&&($count=='0'))
{
$encry_conpass=md5($conpass);//encrypting confirm password

$result2=mysql_query("UPDATE register_data SET password='$encry_conpass' WHERE eMail='".$email."' and password='".$encry_oldpass."' and isValidate=0 and isDelete=0");

echo "Password Chamged Successfully";
header("location:..............."); // redirect to login page

}

else
{
echo"Password Change Fails";
// header("location:..............."); // redirect to password change page
}
?>
No comments posted yet

Your Answer:

Login to answer
111 Like 36 Dislike
Previous forums Next forums
Other forums

.htpasswd Registration Form
Hi,
I wanted to make an htpasswd registration form.
I found this code on the internet but have

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice

Show message after entering data
Hello Colleagues

I would like to display messages after entering the data example: "
dat

downloading a file as HTML
Hi.
I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESS

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

Form always sends to error page...
Hello,
Any help will be greatly appreciated. I am having trouble getting multiple fields to be re

problem when runing a funciton
I am trying to connect to database using a funciton in a functions.php

<?php
funct

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash