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!

Login into Control Panel from HTML File

Discussion in 'General Discussion' started by rickintn, Aug 10, 2007.

  1. rickintn

    rickintn Registered

    Aug 10, 2007
    Likes Received:
    Trophy Points:
    I have a hosting business and the template I am setting up has a place for my customers to login into the control panel. It is an HTML file. When someone tries to login, they enter their username and password. Then, when they hit login, it ask them to enter it again on the CPANEL screen. Is there a way to get it integrated into my HTML file so they only have to enter their information once?

    To see an example of this, go to
  2. rickintn

    rickintn Registered

    Aug 10, 2007
    Likes Received:
    Trophy Points:
    Figured it Out

    I finally figured it out. I found this on a message board

    As you know because of a recent IE patch the old form based cPanel logins directing to a url such as no longer work for most people.

    cPanel have added a built in form to cPanel 9.0 so you just need to send the values "user" and "pass" to that form and away you go.

    You can post the values to any of the following: (cPanel) (secure cPanel) (webmail) (secure webmail)

    Here's a little script you're welcome to use if you like, that gives people the choice of all four logins.

    1. save this as cplogin.php (edit the line with your domain or ip)


    #your domain or ip
    $domain = "";

    if(!$_POST['login']) {

    $user = $_POST['user'];
    $pass = $_POST['pass'];
    $port = $_POST['port'];

    $port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
    <body onLoad="setTimeout('document.forms[0].submit();',10)">
    <form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
    <input type="hidden" name="user" value="<?php echo $user; ?>">
    <input type="hidden" name="pass" value="<?php echo $pass; ?>">

    2. Then the form to use on your site

    <form action="cplogin.php" method="post">
    <table cellspacing="4" cellpadding="0">
    <tr><td>Username:</td><td><input type="text" name="user"></td></tr>
    <tr><td>Password:</td><td><input type="password" name="pass"></td></tr>
    <tr><td>Login To:</td>
    <td align="right">
    <select name="port">
    <option value="2082">cPanel</option>
    <option value="2083">Secure cPanel</option>
    <option value="2095">Webmail</option>
    <option value="2096">Secure Webmail</option>
    <tr><td align="right" colspan="2">
    <input type="submit" name="login" value="login" style="cursor:pointer">

    This should work for most browsers, but remember you need to be running cPanel 9.0 or above.

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