Location: PHPKode > projects > PHPmyEXIM > check.php
<?php
require("config.php");
$tabelle= "domains";

if (isset($_POST['domain']))
{
	$domain = $_POST['domain'];
}
else
{
	$domain = "";
}

if (isset($_POST['passwort']))
{
	$passwort = $_POST['passwort'];
}
else
{
	$passwort = "";
}

/* Connection to the Database */ 
MYSQL_CONNECT($server, $user, $passw) or die ( "<H3>unable to connect to database server</H3>");
MYSQL_SELECT_DB($datenbank) or die ( "<H3>database does not exist</H3>");

//Get Domain and Password
$result=MYSQL_QUERY("select domain_name, password from $tabelle where domain_name = '$domain' and password=PASSWORD('$passwort')");
$row = mysql_fetch_row($result);

$mpw=MYSQL_QUERY("select password from $tabelle where domain_name = 'masterdomain' and password=PASSWORD('$passwort')");
$mpw1 = mysql_fetch_row($mpw);


if($domain == '' && $mpw1[0] != '')
{
	@session_start();
	session_register("session123");
	header("Location: domain_overview.php");
}
else
{

if($passwort == "" || $domain == "") 
{
	include("index.php");
}
elseif ($domain == $row[0] && $row[1] != "")
{
	@session_start();
	session_register("session123");
	header("Location: frame.php?domain=$row[0]");
}
else
{
	include("index.php");
}
}
echo"<p align=\"center\">Sorry, your domain or password is incorrect. Please try again</p>";

/* Verbindung mit SQL-Server beenden */ 
MYSQL_CLOSE();
?>
Return current item: PHPmyEXIM