if ($_POST)
{
// now entering input validation hell
// we need to verify $_POST['hostname'], to make sure it does not exceed 255 characters,
// and that it contains characters valid for a domain name.
//
// Further, we need to figure out the top level domain associated with this hostname
// and we need to make sure that no other users have a domain with the same top level domain
// assigned to them. IsTLD in the Domains table is what we need to look at.
//
// we then need to do a lookup of the top level domain, and make sure the nameservers are pointing
// to our service.
//
// we then need to make sure that the hostname they picked is not already in use in the system.
// we need to verify $_POST['displaydomain'] to make sure it does not exceed 255 characters,
// and that it contains characters valid for a domain name.
// we need to verify $_POST['displayname'] to make sure it does not exceed 255 characters,
// and that it contains valid characters. (alphanumeric, space, period, underscore, hyphen)
// we need to verify $_POST['assignedtemplate'] to make sure it does not exceed 28 characters,
// and that it contains characters valid for a site name (aka template name)
//
// we then need to check that there is a template with the given name owned by the current user
// if all of the above checks pass, we should add the hostname to the database.
}