Php+mysql the method of realizing user registration login _php Skill

Source: Internet
Author: User
Tags php and mysql

This article is an example of the Php+mysql to achieve user registration login method. Share to everyone for your reference. The specific analysis is as follows:

This is a use of PHP and MySQL database implementation of user registration and login code, the function is relatively simple and practical user registration procedures, but also added a user login verification code program, so that a lot of security, the code is as follows:

Copy Code code as follows:
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> in the background to increase user </title>

<body>

<?php
Require_once ("config.php");
if (Isset ($_post["Submit2"])) {
mysql_select_db (' a0807000225 '); This is a database table.
$author =$_session["user_name"];
Define (All_ps, "Jinquan");
echo $username =$_post["username"];
echo $password =md5 ($password =$_post["password"].all_ps);
echo "</br>";
if ($username) {
if ($password) {
$STR = INSERT INTO ' dx_user_list ' (' uid ', ' m_id ', ' username ', ' password ') VALUES (ASCII (NULL), ' 1 ', ' $username ', ' $password '); ";
$rs =mysql_query ($str, $conn);
Mysql_close ($conn);
}
if ($rs) {
echo "<script>alert" (' new Success '); location.href= ' yonghuzc.php ' </script> ';
}else{
echo "<script>alert" (' New failure '); location.href= ' yonghuzc.php ' </script> ';
}
}
}
?>

I hope this article will help you with your PHP program design.

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.