No announcement yet.

login to cPanel from a website form

  • Time
  • Show
Clear All
new posts

  • 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 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)

    PHP Code:

    #your domain or ip 
    $domain ""

    $_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">
    Last edited by KyleC; 04-23-2004, 05:32 PM.