久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php 怎么實現(xiàn)用戶注冊登錄界面

      php實現(xiàn)用戶注冊登錄界面的方法:1、創(chuàng)建log.php登錄主界面;2、設(shè)置register.php注冊主界面;3、通過mysqli_connect連接數(shù)據(jù)庫并進行相應(yīng)的數(shù)據(jù)操作即可。

      php 怎么實現(xiàn)用戶注冊登錄界面

      php入門到就業(yè)線上直播課:進入學(xué)習(xí)
      Apipost = Postman + Swagger + Mock + Jmeter 超好用的API調(diào)試工具:點擊使用

      本教程操作環(huán)境:Windows7系統(tǒng)、PHP8.1版、Dell G3電腦。

      php 怎么實現(xiàn)用戶注冊登錄界面?

      PHP登錄與注冊頁面簡單實現(xiàn)(包含數(shù)據(jù)庫驗證)(包含數(shù)據(jù)庫)

      log.php(登錄主界面)

      由于是簡單的頁面,登錄頁面只做了數(shù)據(jù)庫驗證,其實有條件也可以加上郵箱驗證和驗證碼驗證。

      php 怎么實現(xiàn)用戶注冊登錄界面

      <!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> </head> <style type="text/css"> #aaa{width: 300px; height: 30px;} </style> <body>     <center> <h2>登錄界面</h2>     <form method="POST" action="log_ok.php">        賬號 :<input id="aaa" type="text" name="uname" placeholder="用戶名" />         <br /><br/>        密碼 :<input id="aaa"type="password" name="pwd" placeholder="密碼" />         <br />         <input type="submit" > <input type="reset"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="register.php">注冊賬號</a>     </form> </center> </body> </html>
      登錄后復(fù)制

      log_ok.php

      php 怎么實現(xiàn)用戶注冊登錄界面

      <!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> </head> <body> <?php header("content-type:text/html; charest=UTF-8");//文件編碼格式     // Session需要先啟動。     session_start();     //判斷uname和pwd是否賦值     if(isset($_POST['uname']) && isset($_POST['pwd'])){         $name = $_POST['uname'];         $pwd = $_POST['pwd'];         //連接數(shù)據(jù)庫         require("conn.php");         if ($conn->connect_error) {             die("Connection failed: " . $conn->connect_error);         }         //驗證內(nèi)容是否與數(shù)據(jù)庫的記錄吻合。         $sql = "SELECT * FROM register WHERE (account='$name') AND (password='$pwd')";         //執(zhí)行上面的sql語句并將結(jié)果集賦給result。         $result = $conn->query($sql);         //判斷結(jié)果集的記錄數(shù)是否大于0         if ($result->num_rows > 0) {                          // 輸出每行數(shù)據(jù)     ,,,不知道為什么在這個變量前設(shè)置字符串的時候,必須得用"",''這個是不實現(xiàn)的。。什么不使用也可以成功             while($row = $result->fetch_assoc()) { echo'歡迎'.$row['username'];                 echo '<p> 賬號:' . $row['account'].'  <br/> 姓名:' . $row['username'].' <br/> 性別:' . $row['sex'].'      <br/> 年齡:' . $row['age'].'      <br/> 地址:' . $row['address'].'  <br/> 郵箱:' . $row['mail'].'     <br/> 電話:' . $row['number'].'   <br/> </p>';             }         } else {             echo "沒有您要的信息";         }         $conn->close();  //關(guān)閉數(shù)據(jù)庫          } ?> </body> </html>
      登錄后復(fù)制

      register.php(注冊主界面)

      這個頁面我設(shè)置了,隨機id,只要刷新頁面就會出現(xiàn)一個新的賬戶,但是由于我做的是個簡單的,所以沒有實現(xiàn)id不重復(fù)。有條件,您可以實現(xiàn)一下,可以發(fā)給我互相交流下,另外,重復(fù)密碼驗證我也沒有設(shè)置,這只是個簡單的,您如果想的話,做出來給我發(fā)一份。哈哈。

      php 怎么實現(xiàn)用戶注冊登錄界面

      <!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> </head> <style type="text/css"> .aaa{width: 300px; height: 30px;} </style> <style type="text/javascript"> </style> <body> <?php  $a=mt_rand(333333,999999999); ?> <center> <h2>注冊界面</h2>  <form method="post" name="from1" action="register_ok.php"><!--  在數(shù)據(jù)庫中id是自動增長列  -->      賬號:   <input name="id"  class="aaa" type="text" value="<?php echo"$a";?>"><br/><br/>          姓名: <input  class="aaa" type="text"  name="username"><br/><br/>      性別: <input  class="aaa" type="text"  name="sex"><br/><br/>      年齡: <input  class="aaa" type="text"  name="age"><br/><br/>      地址: <input  class="aaa" type="text"  name="address"><br/><br/>          郵箱: <input  class="aaa" type="text"  name="mail"><br/><br/>      密碼: <input  class="aaa" type="text"  name="password"><br/><br/> 確認   密碼: <input  class="aaa" type="text"  name="repsw"><br/><br/>    手機號:    <input   class="aaa"type="text"  name="number"><br/><br/>         <input type="reset"name="reset" value="重置"> <input type="submit"name="submit" value="注冊"  onClick="myfunction"> &nbsp;&nbsp;  <a href="log.php"><< 返回上一頁</a> <a href="register.php">點擊注冊</a> </form> </body> </html>
      登錄后復(fù)制

      register_ok.php

      php 怎么實現(xiàn)用戶注冊登錄界面

      <!doctype html> <html> <head> <meta charset="utf-8"> <title>無標題文檔</title> </head> </body> <body> <?php include_once("conn.php"); header("content-type:text/html; charest=UTF-8");//文件編碼格式 $id=$_POST['id']; $username=$_POST['username']; $sex=$_POST['sex']; $age=$_POST['age']; $address=$_POST['address']; $mail=$_POST['mail']; $password=$_POST['password']; $number=$_POST['number']; if(!($id and $username and $sex and $age and $address and $mail and $password and $number)){ echo("輸入值不能為空");//判斷變量名是否為空值 }else{ $sqlstr1="insert into register values('".$id."','".$username."','".$sex."','".$age."','".$address."','".$mail."','".$password."','".$number."')"; //執(zhí)行sql   insert語句    把用post引用的變量接入到bookable中 $result = mysqli_query($conn,$sqlstr1);//承接結(jié)果集 if($result){ echo"添加成功"; }else{ echo"<script>alter('添加失敗');history.go(-1);</script>"; } } echo"$id $username $sex $age $address $mail $password $number"; ?> </body> </html>
      登錄后復(fù)制

      conn.php(連接數(shù)據(jù)庫)

      <!doctype html> <html> <head> <meta charset="utf-8"> <title>conn文件</title> </head> <body> <?php $mysql_server_name = 'localhost'; //改成自己的mysql數(shù)據(jù)庫服務(wù)器 $mysql_username = 'root'; //改成自己的mysql數(shù)據(jù)庫用戶名 $mysql_password = ''; //改成自己的mysql數(shù)據(jù)庫密碼 $mysql_database = 'regist'; //改成自己的mysql數(shù)據(jù)庫名 $conn=mysqli_connect($mysql_server_name,$mysql_username,$mysql_password,$mysql_database); //連接數(shù)據(jù)庫 //連接數(shù)據(jù)庫錯誤提示 mysqli_query($conn, 'set names utf8'); mysqli_query($conn, 'set character set utf8'); if (mysqli_connect_errno($conn))  {  die("連接 MySQL 失敗: " . mysqli_connect_error());  } ?> </body> </html>
      登錄后復(fù)制

      數(shù)據(jù)庫

      1.數(shù)據(jù)庫名是regist

      2.表名是register

      php 怎么實現(xiàn)用戶注冊登錄界面

      推薦學(xué)習(xí):《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號