Location: PHPKode > projects > PHPmyEXIM > domain_create.php
<?php
if($_POST['action'] == "yes")
{

$passwort1 = $_POST['passwort1'];
$passwort2 = $_POST['passwort2'];
$newdomain = $_POST['newdomain'];

require("config.php");
$tabelle = "domains";

/* 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>");

$result1=MYSQL_QUERY("select domain_name from $tabelle where domain_name = '$newdomain'");
$row1 = mysql_fetch_row($result1);
if ($row1[0] == "" && $passwort1 == $passwort2)
{
$result=MYSQL_QUERY("insert into $tabelle values('$newdomain', PASSWORD('$passwort1'))");
echo"<html>
<head>
<title></title>
<link rel=stylesheet type=\"text/css\" href=\"global.css\">
</head>
<body>
<p>Your domain has been created successfully.<p><p><a href=\"domain_overview.php\"><img src=\"images/home.gif\" border=\"0\"></a></p>
</body>
</html>";
}
else
{
echo"<html>
<head>
<title></title>
<link rel=stylesheet type=\"text/css\" href=\"global.css\">
</head>
<body>
<p>Your domain has not been created. This domain already exists or the password is not equal.<p><p><a href=\"domain_create\"><img src=\"images/back.gif\" border=\"0\"></a></p>
</body>
</html>";
}

}else
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title></title>
	<link rel=stylesheet type="text/css" href="global.css">
</head>
<body> 
<form name="create_domain" action="<?php echo $PHP_SELF; ?>" method="POST">
<table border="0" cellpadding="4" cellspacing="0">
<tr>
	<input type="hidden" name="action" value="yes">
	<th class="tab" colspan=2>Create domain</th>
</tr>
<tr>
	<td>Domain</td>
	<td><input type="text" size="30" name="newdomain" value=""></td>
</tr>
<tr>
	<td>Password</td>
	<td><input type="password" size="30" name="passwort1" value=""></td>
</tr>
<tr>
	<td>retype Password</td>
	<td><input type="password" size="30" name="passwort2" value=""></td>
	</td>
</tr>
<tr align=center>
	<td colspan="2"><input type="image" src="images/create.gif" name="submit" value="create"></td>
</tr>

</table>
</form>
</body>
</html>
<?php
}
?>
Return current item: PHPmyEXIM