Php+mysql Page Registration Code

Source: Internet
Author: User

Page Setup code:
<! DOCTYPEHtml>
lang="EN">
<metacharset="UTF-8">
<title>title</title>
<body>
<formaction="Register_post.php"Method="POST">
<table>
<tr>
<td> User name:</td>
<td><inputType="Text"Name="Uname"Placeholder="Please enter your account"></td>
</tr>
<tr>
<td> Password:</td>
<td><input type="password" name="Pwod" placeholder="Please enter password"></td>
</tr>
</table>
<input type="Submit" value="registration">
</form>
</body>

Registration Process Page Code:
<?php
/**
* Created by XX.
* User:msi
* DATE:2017/10/24
* time:11:00
*/

Header"Content-type:text/html; Charset=utf-8 ");

Introduce the previous Dbda method set file
Require_once".. /dbda.class.php ";
$db=NewDbda ();
Var_dump ($_post);
If(!Empty($_post)) {
$uname=$_post["Uname"];
Queries whether the user name registered by the user is duplicated with the existing user name in the database and returns the query results;
$sql="SELECT * from t_user WHERE uname = '{$uname}‘";
Echo $sql;
$result=$db-Strquery($sql);

//}
If($result!="0") {
Exit("User name is occupied");
}Else{
$sql _insert=Insert into T_user (UNAME,PWOD) VALUES ('{$_post["Uname"]}‘,‘{$_post["Pwod"]}‘)";
Echo$sql _insert;
$result 2=$db-Query($sql _insert,0);
Var_dump ($result 2);
}
}
echo "Zhang San";
echo $_post[' uname '];
echo $_post[' Pwod '];
?>

<! DOCTYPE html>
< HTML lang= "en" >
Span style= "COLOR: #e8bf6a" > <meta Charset= "UTF-8" >
<title>title</title>
<BODY>

</body>,
</HTML>
< Span style= "COLOR: #e8bf6a" > < Span style= "COLOR: #a5c261" > < Span style= "COLOR: #bababa" > < Span style= "COLOR: #e8bf6a" > this is done!  

Php+mysql Page Registration code

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.