\n"; if (!empty($_POST[submit])) { $username = $_POST[username]; $password = $_POST[password]; $domain = $_POST[domain]; $passwd = md5crypt ("$password"); if (empty($username) or empty($password) or empty($domain)) { print "
\n"; print "You will need to fill all fields.\n"; print "
\n"; print_footer(); exit; } if (!check_email($username)) { print "
\n"; print "The email address that you have supplied at Email is not a valid email address, please go back.\n"; print "
\n"; print_footer(); exit; } $result = db_query ("SELECT * FROM domain WHERE domain='$domain'"); if ($result[rows] != 1) { print "
\n"; print "The domain $domain is not present in the domain table!\n"; print "
\n"; print_footer(); exit; } $result = db_query ("SELECT * FROM admin WHERE username='$username'"); if ($result[rows] == 1) { print "
\n"; print "This email address already exists, please choose a different one.\n"; print "
\n"; print_footer(); exit; } $result = db_query ("INSERT INTO admin (username,password,domain,create_date,change_date) VALUES('$username','$passwd','$domain',NOW(),NOW())"); if ($result[rows] == 1) { print "$username has been added to the admin table!\n"; print "
\n"; } else { print "Unable to add: $username to the mailbox table!\n"; print "
\n"; print_footer(); exit; } } ?> Create a new admin for a domain.
\n"; print_footer(); ?>