<?php 
include_once 'db_functions.php'; 
$db = new DB_Functions(); 
$json = $_REQUEST["changePass"];
if (get_magic_quotes_gpc()){ 
	$json = stripslashes($json); 
}
//Decode JSON into an Array 
$data = json_decode($json); 
//Util arrays to create response JSON 
$a=array();
for($i=0; $i<count($data) ; $i++) {
	//Store User into MySQL DB 
	$res = $db-> changePassword($data[$i]->userid,$data[$i]->old_pass,$data[$i]->new_pass);
	//Based on inserttion, create JSON response     
	array_push($a,$res);
}
echo json_encode($a); 
?>