Hello,
I have the followig code below that will login into the domain's webmail. The code is on a custom login page domain.com/maillogin.php. The code works fine. The only problem is if a user enters a wrong user/password, they get redirected to the default webmail login page, domain.com:2095/login/. I would like to have it go to the domain.com/maillogin.php page. I've been searching around for a solution with no luck thus far. Any help would be great.
Lance
<?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>
I have the followig code below that will login into the domain's webmail. The code is on a custom login page domain.com/maillogin.php. The code works fine. The only problem is if a user enters a wrong user/password, they get redirected to the default webmail login page, domain.com:2095/login/. I would like to have it go to the domain.com/maillogin.php page. I've been searching around for a solution with no luck thus far. Any help would be great.
Lance
<?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>