<?php //version 1.6

include("inc.top.php");

$q2=new Cdb;



	get_logged_info(); //member area init...



	$member_id=$q->f("id");

	$q2->query("SELECT password FROM members WHERE id='$member_id'");
	$q2->next_record();
	if (md5($old_pass) == $q2->f("password")){
		if (($new_pass == $re_pass) && $new_pass != ""){
			$q2->query("UPDATE members SET password=MD5('$new_pass') WHERE id='$member_id'");
		}else{
			$err = 2;
		}
	}else{
		$err=1;
	}

	header("Location: member.area.change_pass.php?err=$err");
	exit;
		

?>