当前位置:网站首页>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);
?>边栏推荐
- 因果AI,下一代可信AI的产业升级新范式?
- Mongodb slow query optimization analysis strategy
- PostgreSQL database high availability Patroni source code learning - etcd class
- What's wrong with SD card data damage? How to recover SD card data damage
- CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
- [set theory] set concept and relationship (set family | set family examples | multiple sets)
- Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
- Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
- Basic syntax of class
- 重绘和回流
猜你喜欢

竞品分析撰写

深潜Kotlin协程(十九):Flow 概述

Function introduction of member points mall system

Joint search set: the number of points in connected blocks (the number of points in a set)
![[Thesis Writing] how to write the overall design of JSP tourism network](/img/02/841e8870c2ef871c182b9bb8252a83.jpg)
[Thesis Writing] how to write the overall design of JSP tourism network
![[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN](/img/7e/50fa6f65b5a4f0bb60909f57daff56.png)
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN

C language series - Section 3 - functions

Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found

vulnhub HA: Natraj

Jincang KFS data bidirectional synchronization scenario deployment
随机推荐
[dynamic programming] subsequence problem
Which Bluetooth headset is good about 400? Four Bluetooth headsets with strong noise reduction are recommended
Five elements of user experience
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
[fxcg] market analysis today
Web - Information Collection
Analysis of the reason why the server cannot connect remotely
How to choose cross-border e-commerce multi merchant system
arthas watch 抓取入参的某个字段/属性
xrandr修改分辨率与刷新率
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
[graduation season · aggressive technology Er] Confessions of workers
How do you use lodash linking function- How do you chain functions using lodash?
[fairseq] 报错:TypeError: _broadcast_coalesced(): incompatible function arguments
[no title] 2022 chlorination process examination content and free chlorination process examination questions
Dive Into Deep Learning——2.1数据操作&&练习
Mila, University of Ottawa | molecular geometry pre training with Se (3) invariant denoising distance matching
MySQL timestampdiff interval
Arthas watch grabs a field / attribute of the input parameter
[Thesis Writing] how to write the overall design of JSP tourism network