Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'dbconfig.php';
- if($_POST)
- {
- $password_change = $_POST['password_change'];
- $password_old = $_POST['password_old'];
- $username_ch = $_POST['username'];
- // $joining_date =date('Y-m-d H:i:s');
- $username_sha1= sha1($username_ch);
- $password_change_sha1 = sha1($password_change);
- $password_old_sha1 = sha1($password_old);
- try
- {
- $stmt = $db_con->prepare("SELECT * FROM login_user WHERE username='$username_sha1'");
- $stmt->execute(array($username_sha1=>$username));
- $count = $stmt->rowCount();
- if($count>=1){
- $stmt = $db_con->prepare("UPDATE login_user SET password='$password_change_sha1' WHERE username='$username_sha1'" );
- //$stmt->bindParam(":jdate",$joining_date);
- if($stmt->execute())
- {
- echo "registered";
- }
- else
- {
- echo "Query could not execute !";
- }
- }
- else{
- echo "1"; // not available
- }
- }
- catch(PDOException $e){
- echo $e->getMessage();
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement