<?php
/*****************************************************************
************* BKWORKS PRO PHP V 0.5 BETA 1 ***********************
******************** BRYAN KOOIENGA ******************************
****************** DECEMBER 20, 2007 *****************************
*****************************************************************/
session_start();
//session_register("user"); (disabled for PHP 5 compatibility)
include("../include/db_info.php");
$form = $_POST['form'];
$user = $_POST['domain'];
$pw = $_POST['pw'];
$pw = md5($pw);
$query = "SELECT * FROM sites WHERE site_url = '$user' AND password = '$pw'";
$results = mysql_query($query) or die("Can't query because " . mysql_error());
$rows = mysql_num_rows($results);
if($rows != 0) {
$results = mysql_fetch_object($results);
if($results -> acct_status == 1) {
header("location: ../index.php?error_code=1&form=" . $form);
} else {
$_SESSION['user'] = $user;
header("location: ../index.php?view=adshome");
}
} else {
header("location: ../index.php?error_code=2&form=" . $form);
}
mysql_close($db);
?>