好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > 基于PHP的登錄和注冊的功能的實現

基于PHP的登錄和注冊的功能的實現

熱門標簽:電子地圖標注怎么修改 公司外呼系統中心 臨沂crm外呼系統平臺 梧州市機器人外呼系統怎么樣 菏澤語音外呼系統運營商 地圖標注符號樣式有 廈門400電話辦理選易號網 天客通地圖標注 如何在世界地圖標注

1.新建三個html文件,兩個php文件和若干個CSS文件和若干個JS文件

2.登錄的html頁面顯示效果圖


3.注冊的頁面的顯示效果圖

4.登錄頁面的form表單代碼

div class="sign-con w1200">
			img src="img/logn-tu.gif" class="sign-contu f-l"/>
			form action="login.php" method="post">
				div class="sign-ipt f-l">
					p>用戶名:/p>
					input type="text" name="username" placeholder="手機號/郵箱" />
					p>密碼:/p>
					input type="password" name="password" placeholder="密碼可見" />
					br />
					button class="slig-btn">登錄/button>
					p>
						沒有賬號?請
						a href="regist.html" rel="external nofollow" >注冊/a>
						a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="wj">忘記密碼?/a>
					/p>
					div class="sign-qx">
						a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="f-r">
							img src="img/sign-xinlan.gif" />
						/a>
						a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="qq f-r">
							img src="img/sign-qq.gif" />
						/a>
						div style="clear: both;">/div>
					/div>
				/div>
			/form>
			div style="clear: both;">/div>
		/div>

5.注冊頁面的form表單代碼

div class="password-con registered">
			form action="regist.php" method="post">
				div class="psw">
					p class="psw-p1">用戶名/p>
					input type="text" name="username" placeholder="HR了" />
					span class="dui">/span>
				/div>
				div class="psw">
					p class="psw-p1">輸入密碼/p>
					input type="password" name="password" placeholder="請輸入密碼" />
					span class="cuo">密碼由6-16的字母、數字、符號組成/span>
				/div>
				div class="psw">
					p class="psw-p1">確認密碼/p>
					input type="password" name="repassword" placeholder="請再次輸入密碼" />
					span class="cuo">密碼不一致,請重新輸入/span>
				/div>
				div class="psw psw2">
					p class="psw-p1">手機號/郵箱/p>
					input type="text" name="telphone" placeholder="請輸入手機/郵箱驗證碼" />
					button>獲取短信驗證碼/button>
				/div>
				div class="psw psw3">
					p class="psw-p1">驗證碼/p>
					input type="text" placeholder="請輸入驗證碼" />
				/div>
				div class="yanzhentu">
					div class="yz-tu f-l">
						img src="img/psw-yanzhengtu.gif" />
					/div>
					p class="f-l">
						看不清楚?
						a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >換張圖/a>
					/p>
					div style="clear: both;">/div>
				/div>
				div class="agreement">
					input type="checkbox" name="hobby" />
					p>
						我有閱讀并同意
						span>《宅客微購網站服務協議》/span>
					/p>
				/div>
				button type="submit" value="注冊" class="psw-btn">立即注冊/button>
				p class="sign-in">
					已有賬號?請
					a href="login.html" rel="external nofollow" >登錄/a>
				/p>
			/form>
		/div>!-- 注冊框結束 -->

6.login.php代碼

?php
  header("Content-type: text/html; charset=utf-8");
  $username = $_POST['username'];
  $password = $_POST['password'];
  $conn = new mysqli('localhost','root','root','shopping');
  if ($conn->connect_error){
    echo '數據庫連接失敗!';
    exit(0);
  }else{
    if ($username == ''){
      echo 'script>alert("請輸入用戶名!");history.go(-1);/script>';
      exit(0);
    }
    if ($password == ''){
      echo 'script>alert("請輸入密碼!");history.go(-1);/script>';
      exit(0);
    }
    $sql = "select username,password from userinfo where username = '$_POST[username]' and password = '$_POST[password]'";
    $result = $conn->query($sql);
    $number = mysqli_num_rows($result);
    if ($number) {
      echo 'script>window.location="index.html";/script>';
    } else {
      echo 'script>alert("用戶名或密碼錯誤!");history.go(-1);/script>';
    }
  }
?>

7.regist.php代碼

?php
  header("Content-type: text/html; charset=utf-8");
    $username = $_POST['username'];
    $password = $_POST['password'];
    $repassword = $_POST['repassword'];
    $telphone = $_POST['telphone'];
    if ($username == ''){
      echo 'script>alert("請輸入用戶名!");history.go(-1);/script>';
      exit(0);
    }
    if ($password == ''){
      echo 'script>alert("請輸入密碼");history.go(-1);/script>';
      exit(0);
    }
    if ($password != $repassword){
      echo 'script>alert("密碼與確認密碼應該一致");history.go(-1);/script>';
      exit(0);
    }
    if($password == $repassword){
      $conn = new mysqli('localhost','root','root','shopping');
      if ($conn->connect_error){
        echo '數據庫連接失敗!';
        exit(0);
      }else {
        $sql = "select username from userinfo where username = '$_POST[username]'";
        $result = $conn->query($sql);
        $number = mysqli_num_rows($result);
        if ($number) {
          echo 'script>alert("用戶名已經存在");history.go(-1);/script>';
        } else {
          $sql_insert = "insert into userinfo (username,password,telphone) values('$_POST[username]','$_POST[password]','$_POST[telphone]')";
          $res_insert = $conn->query($sql_insert);
          if ($res_insert) {
            echo 'script>window.location="index.html";/script>';
          } else {
            echo "script>alert('系統繁忙,請稍候!');/script>";
          }
        }
      }
    }else{
      echo "script>alert('提交未成功!'); history.go(-1);/script>";
    }
?>

8.進入首頁后的圖片


9.數據庫的圖片


到此這篇關于基于PHP的登錄和注冊的功能的實現的文章就介紹到這了,更多相關PHP實現登錄和注冊的功能內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • PHP實現簡單注冊登錄系統
  • 基于PHP實現用戶登錄注冊功能的詳細教程
  • PHP實現的注冊,登錄及查詢用戶資料功能API接口示例
  • PHP實現的登錄,注冊及密碼修改功能分析
  • php注冊和登錄界面的實現案例(推薦)
  • PHP實現簡單注冊登錄詳細代碼

標簽:瀘州 郴州 雞西 綿陽 黃石 貴陽 白城 迪慶

巨人網絡通訊聲明:本文標題《基于PHP的登錄和注冊的功能的實現》,本文關鍵詞  基于,PHP,的,登錄,和,注冊,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《基于PHP的登錄和注冊的功能的實現》相關的同類信息!
  • 本頁收集關于基于PHP的登錄和注冊的功能的實現的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 私密按摩高h精油按摩| 精品国产乱码久久久久久1区2区| 性交网站| 新婚被陌生人强嗯~啊| 女学生婬荡呻吟扒开腿H小说| 男女多p混交群体交乱| 蜜桃啪啪| 熟睡中的mm任我玩| 91人妻精品丰满大屁股干炮| 男女做爰全过程流白浆| 强乱中文字幕在线| 黑帮大佬和我的365日第二季| 国产成人精品自在钱| 色欲久久精品亚洲AV| 美女脱内衣内裤和男生在一个房间亲| 老师你的兔子好大| 男j进女p动态图片| 全文辣肉H短篇少妇| 国产AV在线观看18???| 英语老师c了语文老师一节课| 男女上床视频软件| 小莹的欲乱秘史| 亚洲va综合va国产va中文| 69传媒| 国模私拍一区二区三区| AⅤ亚洲AV天堂波多野吉衣| 国产精品欧美综合亚洲Avl| 叼住了上下晃动的两个奶| 紧缚奴隷护士麻绳调教| XXXX高潮大喷水XXXX| 潘金莲一级婬片免费| 成人禁18视频在线观看| japanese日本护士18| 91麻豆网站| 国产51精品秘?| 色欲AV午夜在线下载一区二区 | 让我成为你的家人电视剧在线看| 国产熟女www视频在线观看| 浮奶一级婬片A片免费播放| 做a视频在线观看| 欲成欢香蕉被你夹断了|