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
36
Other forums
Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is
2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.
1) on IE when i hit enter instea
compile php5 with DOM
Hi,
I can't manage to compile php 5.3.0 from source on Windows to include DOM,
in spite of
default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?
Basic Question Regarding PHP Includes
Hi
Just starting out with PHP.
Working on a site that uses some basic includes, these
Reduce redundancies in switch functions?
Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a swit
Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp
Alternate messaging
I have 4 strings in MySQL db1
$string1 : Hello
$string2 : Hi
$string3 : Great
$strin
Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot
Not adding to db
Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get