<?


//  cP Account Creator Version 0.4 Beta Build 01
//  Copyright (C) 2004 Brian Freeman
//  All Rights Reserved.
//
//  This script set is distributed as is with absolutely no warranty.
//  Users of this script set agree to use at their own risk.
//  Questions or comments?  Contact webmaster@freemans-web.com
//
//
if(!empty($_GET)) extract($_GET);
if(!empty($_POST)) extract($_POST);
if($user=="") {
require("../config.php");
include("template/header.php");


include("template/client_acc.php");


include("template/footer.php");
} elseif($user!="") {

require("../config.php");





//$conn  = mysql_connect($dbhost, $dbusername, $dbpass) or die(mysql_error( ));

//mysql_select_db($dbname,$conn) or die(mysql_error( ));



$get_items="SELECT * FROM email_users WHERE username='$user' && password=password('$pass') && act_sub='1'";

$get_items_res=mysql_query($get_items)  or die(mysql_error( ));

if (mysql_num_rows($get_items_res)==1)  {

	while ($items = mysql_fetch_array ($get_items_res)) {

		$username=$items[username];

		$password = $items[password];

}



header("Location: client_access.php?email=$username&sess=$password");

} else {

echo "You are not authorized to access this page <a href=client_acc.php> Go Back</a>";

}

}

?>

