I have a form that you could probably modify to achieve what you want.
HTML Code:
<form action="/formprocessor.php" method="post" target="_blank">
<input type="hidden" value="2096" name="port" />
<table width="300" style="border:solid 1px #999"align="center" cellpadding="5" cellspacing="0" >
<tr>
<td colspan="2" ><span class="content_emphasis"><div class="webmail"><img src="/images/clearpixel.gif" width="24" height="24" alt="check webmail" /></div>Check Your Webmail:</span><span class="content_dark"><br />
<br />
</span></td>
</tr>
<tr>
<td ><span class="content_dark">Username:</span></td>
<td align="left"> <span class="content_dark">
<input name="user" type="text" class="content" onfocus="clearDefaultandCSS(this)" value="<?php if (isset($email)) {echo $email;} else {echo 'yourname@yourdomain.com';} ?>" size="35" maxlength="50" />
</span></td>
</tr>
<tr>
<td ><span class="content_dark">Password:</span></td>
<td align="left"> <span class="content_dark">
<input name="pass" type="password" class="content" size="35" maxlength="12" value="" />
</span></td>
</tr>
<tr>
<td align="right" colspan="2"><div align="center">
<input name="login" type="submit" class="content_dark" style="cursor:pointer" value="login" />
<br />
<span class="content">For webmail, please use your full email address (yourname@yourdomain.com) as your username. </span></div></td>
</tr>
</table>
</form>
Form Processor:
Code:
<?php
#your domain or ip
$domain = "domainname.com";
if(!$_POST['login']) {
exit;
}
$user = $_POST['user'];
$pass = $_POST['pass'];
$port = $_POST['port'];
$port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
?>
<body onLoad="setTimeout('document.forms[0].submit();',10)">
<form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
<input type="hidden" name="user" value="<?php echo $user; ?>">
<input type="hidden" name="pass" value="<?php echo $pass; ?>">
</form>