PHP, JQ and CSS make Avatar login window _php Tutorial

Source: Internet
Author: User
Tags md5 encryption vars
I designed a simple and interesting login box feature with Gravatar avatar that was exported from gravatar.com based on the message ID. This article is very basic on the level of CSS implementation and a few lines of jquery and PHP code. I hope this login box design gives some special flavor to your Web project. Before attempting this example, please upload your avatar on Gravatar.

498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' title= ' use PHP, jquery and CSS to make Gravatar Avatar login window "height=" "alt=" uses PHP, jquery and CSS to make Gravatar Avatar login window "src=" https://lh3.googleusercontent.com/-RFUV0LFAAbo/T7vN5VAW8tI/ Aaaaaaaagcu/w8cbvtfpbko/s550/loginbox.png "width=" 550 "/>

Create Gravatar Avatar Login windows using PHP, jquery and CSS

Javascript

Contains JavaScript code. $ (". User"). KeyUp (function () {}---User is the name of the input tag, we get the value of input by $ (this). Val (). If the e-mail value passes the regular expression, Ajax will request avatar.php

 
  
  

498) this.width=498; ' OnMouseWheel = ' javascript:return big (This) ' title= ' use PHP, jquery and CSS to make Gravatar Avatar login window "height=" 322 "alt=" uses PHP, jquery and CSS to make Gravatar Avatar login window "src=" https://lh6.googleusercontent.com/-S5T-tywC_QU/T7vffdMlKHI/ Aaaaaaaagck/fz445g_qady/s368/wire.png "width=" 368 "/>

Create Gravatar Avatar Login windows using PHP, jquery and CSS

HTML Code

 
 
  1. < Div id="Login_container">
  2. < Div id="Login_box">
  3. < Div id="Img_box"><img src = "HTTP://WWW.GRAVATAR.COM/AVATAR/?D=MM" alt="" /> Div >
  4. <form Action="login.php" Method="POST"><input ID="username" class="Input User" type="Text" /> <input ID="Password" class="Input passcode" type="Password" /> <input class="BTN" type="Submit" value="Login" /> form> div >
  5. Div >

avatar.php

Here is a very simple code: Receive post email, do MD5 encryption, return the encrypted data.

 
  
  
  1. !--? php
  2. if ( $_post [ ' email ' ])
  3. {
  4. $ email = $_post [ ' email ' ];
  5. $lowercase = strtolower ( $email );
  6. $image = MD5 ( $lowercase );
  7. echo $image ;
  8. }
  9. ?>

Css

 
 
  1. #login _container
  2. {
  3. background : URL (blue. jpg) #006699 ;
  4. Overflow : Auto ;
  5. width : 300px ;
  6. }
  7. #login _box
  8. {
  9. padding : 60px 30px 30px 30px;
  10. Border : Solid 1px #dedede;
  11. width : 238px ;
  12. Background-color : #fcfcfc ;
  13. Margin-top : 70px ;
  14. }
  15. #img _box
  16. {
  17. Background-color : #FFFFFF ;
  18. Border : 1px solid #DEDEDE;
  19. Margin-left : 77px ;
  20. Margin-top : -108px ;
  21. position : Absolute ;
  22. width : 86px ;
  23. Height : 86px ;
  24. }


http://www.bkjia.com/PHPjc/445693.html www.bkjia.com true http://www.bkjia.com/PHPjc/445693.html techarticle I designed a simple and interesting login box feature with Gravatar avatar that was exported from gravatar.com based on the message ID. This article is very basic on the level of CSS implementation and a few lines ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.