Results 1 to 1 of 1

Thread: login to cPanel from a website form

  1. #1
    Senior Member KyleC's Avatar
    Join Date
    Mar 2004
    Location
    Dallas, TX
    Posts
    291

    Lightbulb 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://user:password@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 at 05:32 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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