1
0
Fork 0
gnuviechadmin-historic/php/registerdomain.php
Jan Dittberner dbae3c8bd3 add domain
git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@31 a67ec6bc-e5d5-0310-a910-815c51eb3124
2004-03-08 17:42:14 +00:00

43 lines
No EOL
961 B
PHP

<?php
require_once("tools.php");
require_once("usertypes.php");
$dbh = db_open();
function add_domain() {
global $dbh;
$query = sprintf("INSERT INTO domain (domainname, client) VALUES ('%s', %d)",
$_POST["domainname"],
$_SESSION["client"]);
db_exec($dbh, $query);
}
require("wantauth.php");
session_start();
include("userhead.php");
if (!isset($_POST["mode"])) {
$mode = "step1";
} else {
$mode = $_POST["mode"];
}
switch ($mode) {
case "step1" :
?>
<p><?php print(_("Add new domain")); ?></p>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="mode" value="commit">
<table>
<tr><td><?php print(_("Domain name:")); ?></td><td><input type="text" name="domainname"></td></tr>
<tr><td colspan="2" align="right"><input type="submit" name="submit" value="<?php print(_("add")); ?>"</td></tr>
</table>
</form>
<?php
break;
case "commit" :
add_domain();
default:
break;
}
include("commonfoot.php");
?>