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......


<?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

retrieving images from mysql database using php
So I've been trying to figure out how to store images in a mysql database, and as far as i can tell

PHP FTP Can't upload Big FIles
Anyone had any success using FTP to upload a file say 90m?

im using ftp_put and it returns fa

Remove letter from numeric textbox
I have a textbox that will search the employee database by entering in the employee ID and it will r

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

mod_rewrite.c on windows ??
why it's not working on windows while it's working on other hosts???

this is the code i got

Ignore html and bbcode?
I've created a function to limit the amount of text according to the amount of words.

However

rand() function
just a general question guys a girls, is the rand() function 100% random or is it based on time?

I face problems to extract data from one table and insert it in another one
Hi,

For modifications, I have to extract data from one table and insert it in another one

get url?
how do i get the url of the page i'm currently on, on my website.. i think its get header.. how do i

modifying query string with no page refresh
Hi everybody,
I've tried to get info about my problem all over the internet but i didn't find out

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