login to cPanel from a website form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KyleC
    Senior Member
    • Mar 2004
    • 291

    login to cPanel from a website form

    login to cpanel from a website form

    As you know because of a recent IE patch the old form based cPanel logins directing to a url such as http://userassword@domain.com 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:

    http://yourdomain.com:2082/login/ (cPanel)
    https://yourdomain.com:2083/login/ (secure cPanel)

    http://yourdomain.com:2095/login/ (webmail)
    https://yourdomain.com:2096/login/ (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)

    PHP Code:
    <html> 
    <?php 

      
    #your domain or ip 
      
    $domain "yourdomain.com"

       if(!
    $_POST['login']) { 
       exit; 
       } 

       
    $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?>"> 
    </form> 
    </body> 
    </html>

    2. Then the form to use on your site



    Code:
    <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>
     </select>
     </td></tr>
     <tr><td align="right" colspan="2">
     <input type="submit" name="login" value="login" style="cursor:pointer">
     </td>
    </tr>
    </table>
    </form>
    Last edited by KyleC; 04-23-2004, 05:32 PM.
    -Kyle

Working...