Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Mar 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cPanel login failurl

    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
    Last edited by boy143878; 03-31-2008 at 09:22 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •