Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    phi Guest
    How do I login directly to cpanel from a website? using a form instead of the username/password popup prompt.

  2. #2
    matt2kjones Guest
    thats a tough question

    but u could probably find out by asking the cpanel team these two questions

    what page the form data is sent to

    and the names of the username and password variables

    find out that, and i can happily make u a form if you are unsure on how to do so

  3. #3
    kk Guest
    Here you go, the only thing you need to change is yourserver.com:

    <script
    language="javascript">
    <!-- This version: Hostroute.com -->
    <!-- Based on FTP log in by: Reinout Verkerk -->
    <!-- Web Site: http://www.hostroute.com/script_htaccess.html -->

    <!-- Begin
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    if (username && password && server) {
    var htsite = "http://" + username + ":" + password + "@" + server;
    window.location = htsite;
    }
    else {
    alert("Please enter your username and password.");
    }
    }
    // End -->
    </script></p>
    <form name="login">
    <input type="hidden" name="server"
    value="yourserver.com/cpanel"><table
    border="0" cellspacing="1"
    width="250" bordercolor="#000080">
    <tr>
    <td><font size="2"
    face="Verdana">Username:</font></td>
    <td><font size="2"
    face="Verdana"><input
    type="text" size="10"
    name="username"> </font></td>
    </tr>
    <tr>
    <td><font size="2"
    face="Verdana">Password:</font></td>
    <td><font size="2"
    face="Verdana"><input
    type="password" size="10"
    name="password"> </font></td>
    </tr>
    <tr>
    <td align="center"
    colspan="2"><font size="2"
    face="Verdana"><input
    type="button" name="button"
    value="Login&#33;"
    onclick="Login(this.form)"> </font></td>
    </tr>
    </table>
    </form>

  4. #4
    northwind Guest
    This is pretty useful to know. =)

  5. #5
    phi Guest
    thanks for the replies. What if I need to specify more than one server as some accounts are on one and some on another? Also, can an image be used instead of the submit button and yet work with the onClick? I tried something similar but the image would not work as a submission tool.

  6. #6
    kk Guest
    Changing the submit button should be simple enough, just check a html site. Not sure about the multiple serevr login though, you&#39;ll need to write a php script that interacts with your client management system for that to work.

  7. #7
    kk Guest
    Changing the submit button should be simple enough, just check a html site. Not sure about the multiple serevr login though, you&#39;ll need to write a php script that interacts with your client management system for that to work.

  8. #8
    phi Guest
    I&#39;m using this tag:
    <input name="submit" type="image" id="submit" src="images/a_25.jpg" alt="Login" border="0">

    and this hacked code I found on WHT for multiple servers:
    ===== cpanellogin.html ==========
    <html>
    <head>
    <title>cPanel Login</title>
    </head>
    <body>
    <form method="post" action="cpanel.php">
    Domain Name: www.<input type="text" name="yourdomain" size=&#39;20&#39;><br>
    Username: <input type="text" name="user" size=&#39;10&#39;><br>
    Password: <input type="password" name="pass" size=&#39;10&#39;><br>
    <input type="submit" name="submit" value="Login&#33;">
    </form>
    </body>
    </html>

    ==================================

    ===== cpanel.php ============
    <?
    if (&#036;_POST["submit"]) {
    if ((&#33;&#036;_POST["user"]) || (&#33;&#036;_POST["pass"])) {
    echo("Please complete all fields.");
    }
    else {
    header("Location: http://".&#036;_POST["user"].":".&#036;_POST["pass"]."@&#036;yourdomain:2082");
    }
    }
    ?>
    ==========================
    But the submission doesn&#39;t seem to work with the image submit :huh:

  9. #9
    Join Date
    Feb 2003
    Location
    Virginia
    Posts
    426
    Multiple servers wouldn&#39;t be hard. The only thing you would need to do is create a dropdown menu with all your server names listed in it. When the user goes to login, they enter their username, password, and select which server they are on. Therefore the server variable gets set by the dropdown menu.

    Or you can do it your way (since it&#39;s probably easier for them to remember their own domain. But it&#39;s all up to you how you want to do it.

    Also, you should force the secure server.
    Brian Pauley

    :: Harbor Networks ::
    http://www.harbornetworks.net

    :: SoundSource - Your Online Pro Audio Online Web Resource. ::
    http://www.soundsource.info

  10. #10
    phi Guest
    The multiple server works. Now the only thing is that it doesn&#39;t function with the image as a submit tool instead of a normal button.

Page 1 of 3 123 LastLast

Posting Permissions

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