[php]{ // checking user is authorized…
// expects Base64 encoded version of ‘Basic jdoe:password’
$headers = apache_request_headers();
{ // checking that Authorization data has been supplied
if (empty($headers[‘Authorization’])) { // no credentials
$info->status = ‘failure’;
$info->error->code = 47;
$info->error->text = ‘Basic HTTP authentication required’;
$this->response($info, 401);
}
}
{ // checking to see if the Authorization string is valid
$this->load->database();
$sql = ‘SELECT COUNT(id) AS records FROM users ‘;
$sql .= ‘WHERE basic_http_auth = "’.$headers[‘Authorization’].’";’;
//$this->response($sql, 200);
$query = $this->db->query($sql);
$data = $query->row();
if ($data->records == “0”) {
$info->status = ‘failure’;
$info->error->code = 48;
$info->error->text = ‘Invalid credentials supplied’;
$this->response($info, 401);
}
}
}[/php]
i have this bit of php to check if the password matches but ive stored the password in mysql using md5 what would i need to change to check if the password matches?