<?php
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//   Program Name         : ProPhotoHost                                     //
//   Release Version      : 1.0                                              //
//   Home Page            : http://www.prophotohost.com                      //
//   Program Author       : Jake P                                           //
//   Supplied by          : drew010                                          //
//   Nullified by         : CyKuH [WTN]                                      //
//   Distribution         : via WebForum, ForumRU and associated file dumps  //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////
session_start();
session_register("session_access");
session_register("session_admin");
session_register("session_member_id");

include('i.setup.php');
include('i.connection.php');
include('i.function.php');

if($page_admin_email == $email and $admin_password == $password) {
	$session_access = true;
	$session_admin = true;
	header("location: ./admin.home.php");
	exit;
}

$email = strtoupper($email);

$result = mysql_query("SELECT member_id, member_email, member_password FROM member WHERE member_status = 'A'", $db);
while($data = mysql_fetch_object($result)) {
	if($data->member_email == $email and $data->member_password == MD5($password)) {
		$session_access = true;
		$session_member_id = $data->member_id;
		header("location: ./home.php");
		exit;
	}
}

header("location: ./error.php?error=login");
?>