...

View Full Version : cPanel login failurl



boy143878
03-31-2008, 10:08 PM
Hello,

I am trying to create a webmail login page other than using the cpanel domain.com/webmail. I have the following code below (domain.com/maillogin.php) that works if you enter a correct user/pass. If an incorrect user/pass is entered I get automatically take to domain.com:2095/webmail. Is there a way to be redirected back to domain.com/maillogin.php if an incorrect user/pass is entered


<?php

#Webmail
$protocol = 'http';
$port = 2095;

?>

<html>
<b>cPanel Login</b><br>
<?php
if ($_GET['failed'] == "1") {
echo "Your login attempt failed!";
}
echo "<form action=\"" . $protocol . "://";
echo $_SERVER['HTTP_HOST'] . ":" . $port . "/login/\" ";
echo "method=POST>";
?>
User: <input type=text name=user><br>
Pass: <input type=password name=pass><br>
<?php
echo "<input type=hidden name=failurl value=\"http://" ;
echo $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
echo "?failed=1\">";
?>
<input type=submit value=Login>
</form>
</html>



Thanks,
Lance



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum