WEB Cpanel Login From Web Page

Discussion in 'OT Technology' started by sofarsogood, May 18, 2008.

  1. sofarsogood

    sofarsogood New Member

    Joined:
    Apr 28, 2008
    Messages:
    7
    Likes Received:
    0
    Does anyone know how to do this?
    Thanks in advance!
     
  2. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
  3. sofarsogood

    sofarsogood New Member

    Joined:
    Apr 28, 2008
    Messages:
    7
    Likes Received:
    0
    I meant a script to login to a Cpanel hosting account using a form on a web page
     
  4. thomor25

    thomor25 I make money online....

    Joined:
    Jun 11, 2000
    Messages:
    11,101
    Likes Received:
    0
    Location:
    Denver Colorado
    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
    
    
    <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>
    
     
    
     
  5. Josh

    Josh Guest

    Also if you access it at yoursite/cpanel and click cancel it will take you to a web based login. Just copy the code from the page?
     
  6. sofarsogood

    sofarsogood New Member

    Joined:
    Apr 28, 2008
    Messages:
    7
    Likes Received:
    0
    WOW! Thanks Very Much!!
     
  7. sofarsogood

    sofarsogood New Member

    Joined:
    Apr 28, 2008
    Messages:
    7
    Likes Received:
    0
    Thanks!!!
     
  8. Half-Time

    Half-Time OT Supporter

    Joined:
    Mar 21, 2007
    Messages:
    6,460
    Likes Received:
    0
    Location:
    Houston
    There's usually a problem when you login with bad info it takes you to the cPanel login page... Does this script bypass that?
     
  9. sofarsogood

    sofarsogood New Member

    Joined:
    Apr 28, 2008
    Messages:
    7
    Likes Received:
    0
    I did make some mods to the script and bad login's take you to the Cpanel's webform login - which is just fine with me for now... Thanks for everybody's help!
     

Share This Page