Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Cpanel custom login fail page redirect

Discussion in 'General Discussion' started by boy143878, Mar 30, 2008.

  1. boy143878

    boy143878 Member

    Joined:
    Mar 29, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    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>
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  3. boy143878

    boy143878 Member

    Joined:
    Mar 29, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    I have cPanel's latest build 11.18.3 and still experiencing this issue. I will submit a support ticket.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice