1
0
Fork 0
gnuviechadmin-historic/php/registerdomain.php

43 lines
961 B
PHP
Raw Normal View History

<?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");
?>