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

session variables not working anymore
hello,
i use sessions to handle authentication within my site. my host has been changing a lot of

how to make database item unique
Hey guys,

is it possible to do this:

I have the database item $title being pulled for

add text and number image
hi guys ..

ok see i want the user to add their name and pick a number then click get it and i

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

Why doesn't this work? (SSH2)
This is my script:

Code: <?php
$connection = ssh2_connect('213.251.167.109', 22);

Include a php
Hello,

I'm trying to include a function that shows the recent searches.
Example I have <

Ajax not working on IE 6 for Windows CE
I've created a webpage which uses the classis Ajax in following format:view plaincopy to clipboardpr

Getting Subdomain Name With PHP?
I want to grab the subdomain name with PHP so I can generate database queries.

for example my

MII Trends - add data onto chart object
Hello,

Can anyone please provide some thoughts on my current requirement:
its pretty

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

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