www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: HELP! How Do I create a login form?What is the html code for it?

  1. #16
    Join Date
    Dec 2008
    Posts
    1
    can someone please help:

    I'm wanting to make a simple dummy login page (like the one in earlier in this thread) and simply want to set it up so that regardless of what details a user puts in, a dialog box appears saying that the username/password entered is incorrect and that they should contact the administrator for the correct details.

    can you please tell me the code so that I can use it. Much appreciated.

    also I'd like to change the font that would appear on the login button.

    thanks
    Last edited by technics; 12-19-2008 at 04:30 AM.

  2. #17
    Join Date
    Sep 2008
    Location
    On the Interweb
    Posts
    125
    Quote Originally Posted by technics View Post
    can someone please help:

    I'm wanting to make a simple dummy login page (like the one in earlier in this thread) and simply want to set it up so that regardless of what details a user puts in, a dialog box appears saying that the username/password entered is incorrect and that they should contact the administrator for the correct details.

    can you please tell me the code so that I can use it. Much appreciated.

    also I'd like to change the font that would appear on the login button.

    thanks
    Wow am I the only one who thinks that sounds like someone is trying to illicitly capture other people's passwords??? Here's a better idea. Forget about it and stop trying to hack others' accounts.
    "Why must I be surrounded by frikkin' idiots?!" - Dr. Evil

    "Remember: There are no stupid questions, only stupid people." - Mr. Garrison

  3. #18
    Join Date
    Sep 2009
    Posts
    1

    Help

    Where do i put the username and password. If the username is abcd and password is 1234

  4. #19
    Join Date
    Feb 2010
    Posts
    1
    Quote Originally Posted by Zach Elfers View Post
    Yeah, I know. I made this just for fun, not for something secure. I don't have my own domain, so I am not able to use sercure server-side scripting. I put this in an external JS, just to keep amateurs out. Anybody else could get in.
    where do I place the external JS to make this work?

  5. #20
    Join Date
    Sep 2010
    Posts
    1

    Exclamation Help

    I got what you guys was talking about to work but how can i work that in to this,

    <div style="float: right; text-align: right; font-weight: bold; color: white;">
    <H3></H3> <Provisional users can't create forms action="operations0.php" onSubmit="rememberinput('pilot', )" style="margin: 0px; padding: 0px; margin-top: 70px; margin-right: 3px;" method="POST">
    <table align="left" cellpadding="0" cellspacing="3" style="background: url('/Images/background.png'); font-weight: bold; color: white;">
    <tr><td colspan="2" style="color: white; font-weight: bold;">Pilot Login:</td></tr>
    <tr><td style="color: white; font-weight: bold;">Pilot ID:</td><td class="top"><input type="text" name="pilot"></input></td></tr>
    <tr><td style="color: white; font-weight: bold;">Password:</td><td class="top"><input type="password" name="password"></input></td></tr>

    <tr><td style="color: white; font-weight: bold;">Division:</td><td class="top" align="right" colspan="2">
    <select name="airline">
    <option value="SIA">Passenger</option>
    <option value="SQC">Cargo</option>
    </select>
    </td></tr>

    <tr><td align="right" colspan="2"><input style="background: clear; border: none;" type="image" src="/images/login.png"></input></td></tr>
    </table>
    </form>
    </div>

    PLZ HElp

  6. #21
    Join Date
    Oct 2010
    Posts
    1
    Quote Originally Posted by Mayday View Post
    Wow am I the only one who thinks that sounds like someone is trying to illicitly capture other people's passwords??? Here's a better idea. Forget about it and stop trying to hack others' accounts.
    i dont think he trying to hack it. like me i know that u put your page site url in there some where but where do u put it so it can work right i think he was tryin to test it to see if it work right its not like it got url go here or email go there what i need to know is how to do the login html the sing up html and a html for if they for get there password my site will send it to them

  7. #22
    this is the simple way to create a login form using HTML & PHP,

    <?php
    session_start();
    # DISABLE REGISTER GLOBALS IF CONFIGURED IN PHP.INI
    ini_set('register_globals', false);
    ############################# COPYRIGHT ###################
    ######### This script is release under GPL/UGN Copyright Rules
    ######### Script by www.webune.com
    ######### Please do not remove this message. Thanks.
    echo'
    <div style="float:left;padding-left:10px;">
    <a href="http://www.webune.com">
    <img src="http://www.webune.com/images/headers/default_logo.jpg" border="0" align="Webune Logo">
    </a>
    </div>
    <h1 style="float:left">Login Form Example</h1>
    <div style="clear:left;"></div>
    <hr />';
    $Warning = '<hr>
    <div style="font-weight:bold; color:#FFF; font-size:18px; background-color:#F00">
    IMPORTANT: Please use this script only for learning purposes.
    Under no circumstances use this exact code to implement on a production website.
    This script is NOT SECURED!!! This script lacks many security rules and guidelines to implement on a live website.
    Again, Use this script for learning purposes.
    If you need to learn more about login and password security, visit us at www.webune.com.
    Thank You for trying our script.
    </div>';
    if($_GET['logout'] == 'yes'){
    $_SESSION['ConfigUserSess'] = '';
    $_SESSION['ConfigPasswdSess'] = '';
    echo '<div style="font-weight:bold; color:#060; font-size:18px; text-align: center;" >Congratulations!!!<br><br>
    **** You Are Now Logged Out ****</div><br><br>
    Visit <a href="http://www.webune.com">Webune.com</a> For more Tutorials Like This<br><br>
    <a href="'.$_SERVER['PHP_SELF'].'">Click Here To Login Again</a>'.$Warning;
    exit;
    }
    #### CONFIGURE ####
    # WHEN THE USER SUBMITS THE FORM. THESE VALUES MUST MATCH
    $ConfigUser = 'foo';
    $ConfigPasswd = 'secret';
    #### STOP CONFIGURE ####
    if($_SESSION['ConfigUserSess'] == $ConfigUser && $_SESSION['ConfigPasswdSess'] == $ConfigPasswd){
    # THE USER IS ALREADY LOGGED IN
    echo '<div style="font-weight:bold; color:#060; font-size:18px; text-align: center;">
    Congratulations !!! - You are already logged in. </div><br>
    <a href="'.$_SERVER['PHP_SELF'].'">Click Here To Continue</a><br><br>
    <a href="'.$_SERVER['PHP_SELF'].'?logout=yes">Click Her To Logout</a>'.$Warning;
    }else{
    # FUNCTION TO DISPLAY LOGIN FORM AND ERROR MESSAGES
    function LoginForm($Errors){
    # DISPLAY ANY ERRORS IN RED COLORS
    echo '<div style="color:red;">'.$Errors.'</div>';
    ?>
    <form name="form1" method="post" action="">
    <p>Username:
    <input type="text" name="LoginName">
    [ Enter: foo ]
    </p>
    <p>Password:
    <input type="password" name="UserPassword">
    [ Enter: secret ]
    </p>
    <p>
    <input type="submit" name="Login" value="Login">
    </p>
    </form>
    <?php
    }
    # CHECKS IF LOGIN FORM HAS BEEN SUBMITTED
    if(isset($_POST['Login'])){
    # CHECK IF USERNAME AND PASSWORD MATCH WITH CONFIGURATION
    if(!$_POST['LoginName'] || !$_POST['UserPassword']){
    LoginForm('ERROR: All Fields Are Required.');
    }else{
    if($_POST['LoginName'] == $ConfigUser && $_POST['UserPassword'] == $ConfigPasswd){
    # USERNAME AND PASSWORD MATCH. GIVE USER COOKIE TO LOG USERNAME AND PASSWORD
    $_SESSION['ConfigUserSess'] = $ConfigUser;
    $_SESSION['ConfigPasswdSess'] = $ConfigPasswd;
    echo $_POST['user'].'<div style="font-weight:bold; color:#060; font-size:18px; text-align: center;" >
    Congratulations !!! - IT WORKS !!! You are already logged in.</div><br>
    <a href="'.$_SERVER['PHP_SELF'].'">Click Here To Continue</a><br><br>'.$Warning;;
    }else{
    # USERNAME AND PASSWORD DO NOT MATCH. - SHOW FORM
    LoginForm('ERROR: Your Username and Password Do Not Match.<br>Try Again.<br>
    Username: foo<br>Password: secret<br>');
    }
    }
    }else{
    # FORM HAS NOT BEEN SUBMITTED. SHOW LOGIN FORM
    LoginForm('All Fields Are Required - You are Not Logged In.');
    }
    }
    ?>

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Posting Permissions

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



Recent Articles