Location: PHPKode > projects > ProPHP > ProPHP/content/register/process_register.php
<?php
/*****************************************************************
************* BKWORKS PRO PHP V 0.5 BETA 1 ***********************
******************** BRYAN KOOIENGA ******************************
****************** DECEMBER 20, 2007 *****************************
*****************************************************************/
if(!defined("INDEX")) {
	header("location: ../../?view=home");
}
echo "<div align=\"center\">";
$domain = $_POST['domain'];
if($domain == "") {
	header('location: ?view=register&error=You must enter a username');
}
$pw = $_POST['pw'];
$pw = md5($pw);
include("include/db_info.php");
$query = "SELECT * FROM sites WHERE site_url = '$domain'";
$results = mysql_query($query) or die("Can't query because " . mysql_error());
$results = mysql_num_rows($results);
if($results != 0) {
	$error = "The domain you entered is already registered with us.";
	$errors = 1;
	include("content/register/index.php");
} else {
	$query = "INSERT INTO sites (site_url, password) VALUES ('$domain','$pw')";
	mysql_query($query) or die("Can't query because " . mysql_error());
	$query = "SELECT site_number FROM sites WHERE site_url = '$domain' AND password = '$pw'";
	$site_number = mysql_query($query) or die("Can't get site number because " . mysql_error());
	$site_number = mysql_fetch_object($site_number);
	$site_number = $site_number -> site_number;
	mkdir("ads/" . $site_number . "/");
	$query = "SELECT reg_success_msg FROM settings WHERE always_one = '1'";
	$results = mysql_query($query) or die("You have been successfully registered.<br />Please tell the admin that there has been a problem with the database.<br />Here is the debugging information: " . mysql_error() . "<br />");
	$results = mysql_fetch_object($results);
	echo "<h3>Success!</h3>\n";
	echo $results -> reg_success_msg . "<br>";
	echo "Please <a href=\"?view=logon\">click here</a> to log on.";
}
echo "</div>";
?>
Return current item: ProPHP