[Go]php User Login Code _php Tutorial

Source: Internet
Author: User
Tags mysql tutorial
A very detailed login code, for PHP beginners have a lot of help, the need for friends can be viewed for free.

index.php Tutorials

The code is as follows Copy Code




System Login



System Background Login




Database Tutorial Connect connect.php

The code is as follows Copy Code

$connect =mysql tutorial _connect ("localhost", "root", "") or Die ("Server Connection Failed");
mysql_select_db ("Test", $connect) or Die ("no corresponding database established");
$sql = "SELECT * from admin";
?>

Image Verification Code piccheck.php

The code is as follows Copy Code
/*
* Created on 2011-8-10
*
* To change the template for this generated file go to
* Window-preferences-phpeclips Tutorial E-php-code Templates
*/
Session_Start ();
$code =rand (0,9). Dechex (rand (10,15)). Rand (0,9). Dechex (rand (10,15));
$_session[pic]= $code;
$image =imagecreatetruecolor (50,18);
$color =imagecolorallocate ($image, 0,0,0);//Use a color palette for the first time, set as background color
$colortext =imagecolorallocate ($image, Rand (100,255), Rand (100,255), Rand (100,255));
Imagestring ($image, 10,rand (1,15), rand (1,5), $code, $colortext);
Imagegif ($image);
?>

CSS.CSS file

code as follows copy code

@charset "Utf-8";
/* CSS Document */

Body {
Background-color: #9CF;
Text-align:left;
}
#denglu {
width:400px;
margin-top:0px;
Margin-right:auto;
margin-bottom:0px;
Margin-left:auto;
Background-image:url (images/login.gif);
Background-repeat:no-repeat;
height:320px;
text-indent:6px;
}
#box #denglu Form {
position:relative;
top:50px;
left:10px;
width:92%;
}
. Must {
Color: #F00;
font-size:12px;
}
#box #denglu #pic {
Background-image:url (images/dot1.gif);
Background-repeat:no-repeat;
height:20px;
width:100px;
font-size:12px;
Color: #F00;
Text-align:left;
line-height:18px;
left:10px;
top:30px;
position:relative;
}

http://www.bkjia.com/PHPjc/631327.html www.bkjia.com true http://www.bkjia.com/PHPjc/631327.html techarticle A very detailed login code, for PHP beginners have a lot of help, the need for friends can be free to view. index.php Tutorial Code Copy Code as follows! DOCTYPE ...

  • 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.