<?php require_once 'config.inc.php'; require_once 'functions.php'; if ($_POST['data'] && isset($_POST['datalio'])) { $name = $_POST['data']; $id = $_POST['datalio']; $data = array('category_name' => $name); $fil = array('category_id' => $id); UpdatePDO('video_category', $data, $fil); }
$res->bindValue(':id', $_SESSION['id'], PDO::PARAM_INT); $res->bindValue(':pwd', $old); $res->execute(); //$dbh=null;//it is good practice to null $dbh db connection $data = $res->fetch(PDO::FETCH_ASSOC); //print_r($data);die; if ($data['password'] === $old) { $data = array('password' => $new); $filter = array('user_id' => $_SESSION['id']); /* $query="UPDATE library_user SET password=:pwd WHERE user_id=:user_id"; $res=$dbh->prepare($query); $res->bindValue(':pwd',$new); $res->bindValue(':user_id',$_SESSION['id']); $res->execute(); */ UpdatePDO('library_user', $data, $filter); header("Location: logout.php"); } else { header("Location: changepassword.php?error=yes"); } } include 'header.php'; ?> <script language="javascript"> function validform(){ var y=document.forms["myForm"]["old"].value; if(y==null || y=="" || y.length<3) { alert('please enter old password'); document.forms["myForm"]["old"].focus(); return false;