Hi yola,
what you can do is use header() to redirect to what ever the subdomain he/ she typed.
ex:
if(isset($_POST['submit']))
{
if(trim($_POST['letters']) <> '')
{
$fullDomain = 'http://'.trim($_POST['letters']).'.domain.com';
header("Location: ".$fullDomain);
}
}
make sure you put this on top of your code. Reason been that, when you use header() you cann`t output anything before it.
Hope this solve your problem.
Best regards,
Niroshan