Results 1 to 8 of 8

Thread: Login Box

  1. #1

    Login Box

    Ive seen this on many hosting sites, and would like to add this to my new one im almost done with.

    I have the box for username and password. I want it where when the page loads theres text in each that says "username" and the other "password". Then When they enter that and click the button, they enter their cpanel.

    Do any of you know how to do this, or have any references for me to look at?

    Thanks a bunch

  2. #2
    Join Date
    Aug 2002
    Location
    here
    Posts
    1,568
    There is a good how to in the cpanel forums for this. I have seen it done a few ways.
    Dave

  3. #3
    I looked in the control panel forum and didnt see anything, but i will continue to look. Links appreciated

  4. #4
    Join Date
    May 2004
    Posts
    500
    I'm not sure about cpanel, because I don't own a copy/have access to the files of it. But can you open the cpanel files and see where the form is, what the code is for it, then create a similar one in your website, eg, if the form in the cpanel code looks like;

    <form action="login.php" method="post">
    <input type="text" name="uname">
    <input type="password" name="pword">
    </form>

    then you would create a form that will submit the details to the cpanel login.php file, and make sure the username and password fields are correctly named.

  5. #5
    Thanks,

    Do any of you know how to make it when the page loads in one box it has the text "username" and in the other "password" automatically?

  6. #6
    Join Date
    May 2004
    Posts
    500
    <input type="text" name="uname" value="Username">
    <input type="password" name="pword" value="Password">

  7. #7
    Join Date
    Sep 2004
    Posts
    311
    Add a bit of Javascript code so that when the box is clicked in, it makes the text disappear. Works more effectively:

    Code:
    onfocus="this.value=''";
    Just add that to all your form fields. So, an example form field would be:

    Code:
    input type="text" name="nameHere" value ="Username" onfocus="this.value=''";
    Will.

  8. #8
    Join Date
    Oct 2004
    Posts
    1,168
    2 parts:

    cplogin.php
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head>
    <title>Logging In ...</title>
    <?php

    # domain or ip (no [url]http://[/url])
      
    $domain 'mydomain.com';

    if(!
    $_POST['login']) exit;

        
    $user $_POST['user'];
        
    $pass $_POST['pass'];
        
    $port $_POST['port'];
       
        
    $port == '2083' || $port == '2096' $pre 'https://' $pre 'http://';
        
    $port == '2095' || $port == '2096' && !eregi('@'$user) ? $user $user.'@'.$domain $user $user;
       
    ?>
    <meta http-equiv="Content-Language" content="en" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <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>
    login.html
    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 Oakii; 05-01-2005 at 06:42 PM.
    www.Yekaroo.com - Your Chinese Radio Online!

Posting Permissions

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