Page 1 of 3 123 LastLast
Results 1 to 25 of 57
  1. #1
    Join Date
    Oct 2002
    Posts
    62

    login script on Cpanel??

    My current Cpanel login screen is a pop-up screen

    Are there a script that can allow me to put a cpanel login section on my page? so my clients can log into their cpanel account?
    Great Deal Hosting

  2. #2
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    Save this as the file you want to have the login form on...
    PHP Code:
    <html>
    <
    head>
    <
    title>cPanel Login</title>
    </
    head>
    <
    body>
        <
    form method="post" action="cpanel.php">
            
    Username: <input type="text" name="user"><br>
            
    Password: <input type="password" name="pass"><br>
            <
    input type="submit" name="submit" value="Login!">
        </
    form>
    </
    body>
    </
    html
    Now save this as "cpanel.php"...
    PHP Code:
    <?
        
    // Note: Change "yoursite.com" to your domain
        
    if ($_POST["submit"]) {
            if ((!
    $_POST["user"]) || (!$_POST["pass"])) {
                echo(
    "Please complete all fields.");
            }
            else {
                
    header("Location: http://".$_POST["user"].":".$_POST["pass"]."@www.yoursite.com:2082");
            }
        }
    ?>
    If the user doesn't enter a username or password it will tell
    them to complete it, if they enter both, it will log them into cPanel.

    Hope it helps.
    Last edited by digitok; 04-05-2003 at 06:01 AM.
    nu-metal.org :: coming soon

  3. #3
    Join Date
    Oct 2002
    Posts
    62
    thank you digitok
    this is really helpful
    Great Deal Hosting

  4. #4
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    No problem Also, I just edited it a minute ago, so you should copy it again. If you want the forms on an existing page, just use from <form> to </form>.
    nu-metal.org :: coming soon

  5. #5
    Nice bit of code. I hacked your code a bit. The reason? If you have multiple web servers, you need a bit more flexibility, so I added a form field for the customer domain name.

    ===== 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='20'><br>
    Username: <input type="text" name="user" size='10'><br>
    Password: <input type="password" name="pass" size='10'><br>
    <input type="submit" name="submit" value="Login!">
    </form>
    </body>
    </html>

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

    ===== cpanel.php ============
    <?
    if ($_POST["submit"]) {
    if ((!$_POST["user"]) || (!$_POST["pass"])) {
    echo("Please complete all fields.");
    }
    else {
    header("Location: http://".$_POST["user"].":".$_POST["pass"]."@$yourdomain:2082");
    }
    }
    ?>
    ==========================

  6. #6
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    So it's basically the same, except the server bit, yeah, but if you expect them to fill in all them details they might aswell just type in www.domain.com:2082 and login using the popup box themselves
    nu-metal.org :: coming soon

  7. #7
    Join Date
    Oct 2002
    Posts
    62
    cool guys,
    thanks alot
    these have been very helpful for me
    Great Deal Hosting

  8. #8
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    No problems If you ever need more help, you know where to come.
    nu-metal.org :: coming soon

  9. #9
    Join Date
    Feb 2003
    Posts
    70
    I get a blank cpanel.php page after submitting the form. I have checked the fields and they are correct. The form action is set to post to cpanel.php. Any idea what's wrong?
    Last edited by irishblue; 05-13-2003 at 10:28 AM.

  10. #10
    Join Date
    Jun 2003
    Posts
    83
    *delete this*
    Last edited by urbanweb; 09-03-2003 at 03:11 PM.

  11. #11
    hello,

    I just wanted to say digitok thank you for that code it was really helpfull.


    Regards,
    Eric

  12. #12
    How would you go about using this script for logging into neomail from cpanel. I tried using the script by changing the url and port but that didn't work. Any ideas?

  13. #13
    Join Date
    Feb 2003
    Posts
    37
    Hey digitok,

    Your cpanel log-in script looked good, so I tried it, the form comes up, and it looks good, how ever after putting in the username & password, another form comes up asking for the input of username & password, what am I doing wrong?
    I would really appreciate some help.
    Thanks, George

  14. #14
    I realize that logging in from the hosting company's main page is a nice feature for clients, I use one myself. However if you have to enter a username and password why would you want to do it through an unencrypted form?

    Just use a link that points to https://www.yourdomain.com:2083 and take advantage of a secure log in to CPanel...

  15. #15
    Join Date
    Feb 2003
    Posts
    37
    Like you said Watcher_TVI,
    "logging in from the hosting company's main page is a nice feature for clients" that is why I would have liked to have it.

    Thanks, George

  16. #16
    Join Date
    Nov 2002
    Location
    CA, USA
    Posts
    1,903
    Originally posted by Global
    Hey digitok,

    Your cpanel log-in script looked good, so I tried it, the form comes up, and it looks good, how ever after putting in the username & password, another form comes up asking for the input of username & password, what am I doing wrong?
    I would really appreciate some help.
    Thanks, George
    I modify it a bit so it will take you right in

    Code:
    <?   
          // Note: Change "yoursite.com" to your domain   
          if ($_POST["submit"]) {   
              if ((!$_POST["user"]) || (!$_POST["pass"])) {   
                  echo("Please complete all fields.");   
              }   
              else {   
     ?>   
     <HTML> 
     <HEAD> 
     <META HTTP-EQUIV="refresh" content="0;URL=http://<?=$_POST["user"]?>:<?=$_POST["pass"]?>@www.yourdomain.com:2082">  
     </HEAD> 
     </HTML> 
     <? 
              }   
          }   
     ?>
    ◊ James | sales@vnpixel.com |
    ◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
    ◊ http://www.vnpixel.com

  17. #17
    Join Date
    Nov 2002
    Location
    CA, USA
    Posts
    1,903
    btw, it is the cpanel.php file
    ◊ James | sales@vnpixel.com |
    ◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
    ◊ http://www.vnpixel.com

  18. #18
    Join Date
    Feb 2003
    Posts
    37
    Thanks VNPIXEL,

    You did it, it's working great.

    Thanks again, George

  19. #19
    Hello i changed the submit button in a graphical button, but it doesn't work.. here's the button code:

    <input type="image" src="images/26.jpg" name="submit width="59" height="33">

    When i click it, it goes to the cpanel.php page but it's blank How do i make it work?

  20. #20
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    If that code you pasted is the exact same code you're using... You're missing a " after name="submit.
    nu-metal.org :: coming soon

  21. #21
    thank you for a script i was looking for it too

  22. #22
    Join Date
    Nov 2002
    Location
    CA, USA
    Posts
    1,903
    <input type="image" src="images/26.jpg" name="submit" width="59" height="33">
    ◊ James | sales@vnpixel.com |
    ◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
    ◊ http://www.vnpixel.com

  23. #23
    Join Date
    Jan 2003
    Location
    Perth, WA, Australia
    Posts
    1,276
    Uhh... Thanks for the repeat VNPIXEL? :-/
    nu-metal.org :: coming soon

  24. #24
    Originally posted by VNPIXEL
    <input type="image" src="images/26.jpg" name="submit" width="59" height="33">

    Even when i add the ", it still doesn't work. It stucked at the blank cpanel.php page

  25. #25
    Join Date
    Nov 2002
    Location
    CA, USA
    Posts
    1,903
    I just try to put the color and bold on the part you told him. NOT TRY to take your credit. *sigh*
    ◊ James | sales@vnpixel.com |
    ◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
    ◊ http://www.vnpixel.com

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
  •