cPanel, WHM, Webmail login script
By: Daniel

Now the brains of this script.

<?php
// make sure all needed information is provided
if($_POST['domain'] && $_POST['username'] && $_POST['pass'] && !($_GET['failed'] == "1")) {
    $port = $_POST['port']; // sets the port number to login to
    // Get the protocol to use for this connection
    switch($port) {
      case '2082': // cPanel
      case '2086': // WHM
      case '2095': // Webmail
        $protocol = 'http://';
        break;
      case '2083': // Secure cPanel
      case '2087': // Secure WHM
      case '2096': // Secure Webmail
        $protocol = 'https://';
        break;
    }
  // Build the URL
  $redirectlocation = $protocol.$_POST['domain'].':'.$port.'/login/?user='.$_POST['username'].'&pass='.$_POST['pass'].'&failurl='.$_POST['failurl'];
  header ("Location: ".$redirectlocation); // Send URL
} else {
  $error = 1;
  header ("Location: ".$_POST['failurl']); // Send URL if all neede information is not provided
}
?>

I commented this out so you can see what is actually going on and should be fairly easy.

You can save this as anything, I choose cpanelLogin.php and then post to this file in the form you created on the previous page.

Pages: 1 2

15 Votes | Average: 4.73 out of 515 Votes | Average: 4.73 out of 515 Votes | Average: 4.73 out of 515 Votes | Average: 4.73 out of 515 Votes | Average: 4.73 out of 5 (15 votes, average: 4.73 out of 5)
Loading ... Loading ...
del.icio.us:cPanel, WHM, Webmail login script digg:cPanel, WHM, Webmail login script spurl:cPanel, WHM, Webmail login script wists:cPanel, WHM, Webmail login script simpy:cPanel, WHM, Webmail login script newsvine:cPanel, WHM, Webmail login script blinklist:cPanel, WHM, Webmail login script furl:cPanel, WHM, Webmail login script reddit:cPanel, WHM, Webmail login script fark:cPanel, WHM, Webmail login script blogmarks:cPanel, WHM, Webmail login script Y!:cPanel, WHM, Webmail login script smarking:cPanel, WHM, Webmail login script magnolia:cPanel, WHM, Webmail login script segnalo:cPanel, WHM, Webmail login script

17 Responses to “cPanel, WHM, Webmail login script”

  1. harris david Says:

    i want cPanel, WHM, Webmail login account.

  2. Richard Matovu Says:

    Hi, thanks so much for sharing this out. I’ve looked for this for quite a lot of time but I am glad to have found a solution here. Please keep it up. However, I would like to know if there is a way I could skip the cPanel Management so that I go directly to Squirrelmail. On my host, I only have one email application squirelmail but still I have to go through cPanel Management

  3. Alex Says:

    Cant understand what changes i have to do in “the brains of this script” and where to put it?

  4. Peter Says:

    Very useful thank you!

  5. Flávio Costa Says:

    Excelent! :)

  6. Kai Says:

    Okay thanks for this.
    ^_^

  7. Vikash Sharma Says:

    Hi I really apreciate this kind of work but it was hard to find it on google I would spread the link of this website so as to appreciate the work
    KEEP GOING

  8. Wahoo Says:

    Thank you for sharing!

  9. Bass Says:

    Thank you, keep it up.

  10. dash Says:

    plese give me script for cpanelLogin.php

  11. Daniel Says:

    Dash, the cpanelLogin.php is on page 2 of this article: http://www.wlscripting.com/tutorial/33/2/

  12. firewind Says:

    Thank you for sharing!
    dash see : http://www.wlscripting.com/tutorial/33/2/

  13. John Says:

    // This failurl allows cPanel to redirect back to this site
    this not work. if all field is complete and the pass or user is wrong then show cpanel login page.

  14. Hrishikesh Says:

    I have tried this script but unable to login.
    Where to add ip address in this script.

  15. bazish Says:

    Thanks for the most wanted script.
    i followed all the instructions, but i got stuck when i input all required information correctly. the error is page can not be displayed.

    i saved the cpanelLogin.php file on server in the same directory from where my page refering this to post. but the same error.
    Yes my server is php enabled. all other php scripts working which are provided here at your site.(the ones that i checked).
    hope to get solution soon as i needed this script.
    thanks

  16. Billy Says:

    If I have customers on more than 1 server, then how would I best integrate the webmail login form? I mean, how does the script know which server to interact with to log the customer into there webmail?

    If anyone has experienced this issue, could you please share?

    Thanks.

    Magik

  17. Daniel Says:

    This automatically determines which server to login to due to the user putting in their own domain name in the form. Since DNS knows which server that domain name is on it routes the requests to that server.

Leave a Reply

eXTReMe Tracker
geovisitors