include"../../../dsn/conn.php"; session_start(); $userId=$_SESSION["userId"]; $loginid=$_SESSION["loginid"]; if(count($_POST)){ foreach ($HTTP_POST_VARS as $key => $value) { $$key = $value; } } if($sub=="Submit") { $v = verifyForm(); if ($v == 1) { updateSupport(); } } function updateSupport(){ global $loginid,$password,$conn; $sql="update GR_LOGIN_INFORMATION set GR_PASSWORD='$password' where GR_LOGIN_ID='$loginid'"; $stmt = OCIParse($conn, $sql); if (OCIExecute($stmt)) { $msg= "Password has been changed "; echo $msg; } } ?>
function verifyForm() { global $loginid,$oldpassword,$conn; $loginid=strtoupper($loginid); $role_sql = "select count(*) as CNT from GR_LOGIN_INFORMATION where GR_PASSWORD = '$oldpassword' and GR_LOGIN_ID='$loginid'"; $rs1 = OCIParse($conn, $role_sql); OCIExecute($rs1); OCIFetchInto($rs1, $row1, OCI_ASSOC); if($row1["CNT"] > 0) { $return = 1; }else { $return = 0; } OCIFreeStatement($rs1); return $return; } ?>