当前位置:网站首页>Php+mysql registration landing page development complete code
Php+mysql registration landing page development complete code
2022-07-03 04:24:00 【Mung east corner】
Exhibition :

register .html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title> register </title>
</head>
<body>
<div id="div1">
<form enctype="\u4e00~\u9fa5" method="post" action="./login.php" name='form' id='form'>
<table>
<h2> register </h2>
<tr>
<td>
<p><span> account number :</span><input type="text" class="input" name='user' id='user'></p>
</td>
</tr>
<tr>
<td>
<p><span> password :</span><input type="password" id='pasd' class="input" name='pasd'></p>
</td>
</tr>
<tr>
<td>
<input class="buttorn" type="submit" name='submit' id='submit' value=" register "
onclick="returncheck(form);">
<input class="buttorn" type="reset" name='reset' id='reset' value=" Refill ">
</td>
</tr>
</table>
</form>
</div>
</body>
</html>land .html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title> land </title>
</head>
<body>
<div id="div1">
<form enctype="\u4e00~\u9fa5" method="post" name='denglu' action='./login2.php'>
<table>
<h2> Sign in </h2>
<tr>
<td>
<p><span> account number :</span><input type="text" name='username' class="input"></p>
</td>
</tr>
<tr>
<td>
<p><span> password :</span><input type="password" name='password' pattern="\u4e00~\u9fa5" class="input"
maxlength="9" autofocus></p>
</td>
</tr>
<tr>
<td><input class="buttorn" type="submit" value=" Sign in " readonly="readonly"><a href="./ register .html"><input
class="buttorn" onclick="window.location.href('./ register .html')" type="button" value=" register "
readonly="readonly"></a></td>
</tr>
</table>
</form>
</div>
</body>
</html>welcom.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<title>welcome</title>
<style>
</style>
</head>
<body>
<div id="div1">
<h2> Welcome !</h2>
</div>
</body>
</html>style.css
#div1 {
background-image: url(./form_bg.jpg);
background-position: left top;
width: 1431px;
height: 717px;
background-repeat: no-repeat;
position: relative;
}
body,
form,
h1,
p,
div {
margin: 0px;
padding: 0px;
}
body {
font-family: Microsoft YaHei ;
font-size: 12px;
}
form {
width: 600px;
height: 400px;
margin-top: 50px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
padding-left: 30px;
position: absolute;
left: 48%;
top: 10%;
}
h2 {
text-align: center;
;
margin-top: 16px;
margin-bottom: 16px;
margin-left: -20px;
margin-right: 150px;
font-size: 40px;
}
p {
margin-top: 20px;
}
span {
width: 75px;
display: inline-block;
padding-right: 10px;
text-align: right;
}
.input {
width: 200px;
height: 18px;
border: 1px solid #38a1bf;
padding: 2px;
}
#input {
width: 100px;
height: 24px;
}
.buttorn {
width: 100px;
height: 30px;
background-color: #93b518;
margin-top: 20px;
margin-left: 75px;
border-radius: 3px;
font-size: 18px;
font-family: Microsoft YaHei ;
color: white;
}
span {
font-size: 20px;
}login.php( For registration )
<?php
header("Content-type:text/html;charest=utf-8");
session_start();
if (!isset($_POST['user'])){
echo "<script type='text/javascript'>alert(' Your form has not been completed !');</script>";
exit(" Wrong execution ");
}
include('./connect.php');
$user=$_POST['user'];
$pasd=$_POST['pasd'];
$result2=mysqli_query($conn,'select * from denglu where username=$user');
if($result2){
echo "<script type='text/javascript'>alert(' The user already exists !');</script>";
}
else{
$result3=mysqli_query($conn,"insert into denglu(id,username,password) values(null,'$user','$pasd');");
echo "<script type='text/javascript'>alert(' Registered successfully !');</script>";
}
mysqli_close($conn);// Close the database
?>login2.php( It's for landing )
<?PHP
header("Content-Type: text/html; charset=utf8");
if(!isset($_POST["submit"])){
exit(" Wrong execution ");
}// Check if there is submit operation
include('./connect.php');// Linked database
$username = $_POST['username'];//post Get the user name form value
$passowrd = $_POST['password'];//post Get the user password single value
if ($name && $passowrd){// If the user name and password are not empty
$sql = "select * from denglu where username = '$username' and password='$passowrd'";// Check whether the database has corresponding username and password Of sql
$result = mysqli_query($conn,$sql);// perform sql
$rows=mysqli_num_rows($result);// Returns a number
if($rows){//0 false 1 true
header("refresh:0;url=welcome.html");// If successful, jump to welcome.html page
exit;
}else{
echo " Wrong user name or password ";
echo "
<script>
setTimeout(function(){window.location.href='login.html';},1000);
</script>
";// If you use js 1 Seconds later, jump to the login page and try again , Let it input again
}
}else{// If the user name or password is empty
echo " The form is incomplete ";
echo "
<script>
setTimeout(function(){window.location.href='login.html';},1000);
</script>";
// If you use js 1 Seconds later, jump to the login page and try again , Let it input again
}
mysqli_close($conn);// Close the database
?>connect.php( Connect to database )
<?php
$dbhost = "127.0.0.1";
$dbuser = 'root';
$dbname = "denglu"; // Database name
$dbtable='denglu';
$dbpass = ""; // Database password
$conn=mysqli_connect($dbhost,$dbuser,$dbpass);
if($conn=mysqli_connect($dbhost,$dbuser,$dbpass)){
echo "<script type='text/javascript'>alert(' Successful connection ');</script>";
}
else{
echo "<script type='text/javascript'>alert(' The connection fails ');</script>";
}
$connt=mysqli_select_db($conn,$dbname);
?>边栏推荐
- PostgreSQL database high availability Patroni source code learning - etcd class
- 多板块轮动策略编写技巧----策略编写学习教材
- 使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
- Database management tool, querious direct download
- RSRS指标择时及大小盘轮动
- [untitled] 2022 safety production supervisor examination question bank and simulated safety production supervisor examination questions
- 2022 beautician (intermediate) new version test questions and beautician (intermediate) certificate examination
- 2022-02-12 (338. Bit count)
- 会员积分商城系统的功能介绍
- 2022-02-13 (347. Top k high frequency elements)
猜你喜欢

JS realizes lazy loading of pictures
![[free completion] development of course guidance platform (source code +lunwen)](/img/14/7c1c822bda050a805fa7fc25b802a4.jpg)
[free completion] development of course guidance platform (source code +lunwen)

Preliminary cognition of C language pointer

Fcpx template: sweet memory electronic photo album photo display animation beautiful memory

Solve BP Chinese garbled code

会员积分商城系统的功能介绍

拆一辆十万元的比亚迪“元”,快来看看里面的有哪些元器件。

The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade

GFS分布式文件系统(光是遇见已经很美好了)

Introduction of pointer variables in function parameters
随机推荐
Busycal latest Chinese version
CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
Competitive product analysis and writing
When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully
Classes in TS
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
arthas watch 抓取入参的某个字段/属性
2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =
[set theory] set concept and relationship (set family | set family examples | multiple sets)
vulnhub HA: Natraj
How do you use lodash linking function- How do you chain functions using lodash?
x Problem B
Basic use of continuous integration server Jenkins
sklearn数据预处理
Export of zip file
Xrandr modify resolution and refresh rate
FFMpeg filter
Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
[software testing-6] & Test Management
Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended