PHP編寫學校網站上新生註冊登陸程式的執行個體分享,php執行個體_PHP教程

來源:互聯網
上載者:User

PHP編寫學校網站上新生註冊登陸程式的執行個體分享,php執行個體


就弄了三個頁面:

(1)、新生資訊註冊模組(register.php):

      班級註冊表            河南理工大學真誠歡迎2012級新同學到校學習        

新生註冊系統


(2)、資訊查詢登入模組(mysql_stu.php):

新生登陸系統   <?php    //串連資料庫;    $link = mysql_connect('localhost','root','Dongsheng');    if(!$link)    {      echo "與資料庫連接失敗!";      die('Could not connect: ' .mysql_error());    }    $createdb="create database if not exists mis_stu";    $result=mysql_query($createdb)      or die("
資料庫建立失敗:".mysql_error()); $result=mysql_select_db(mis_stu) or die('選擇mis_stu資料庫失敗:'.mysql_error()); $createtable="create table if not exists stu_reg (stu_name varchar(30) not null,stu_sex char(2),stu_age int,stu_class varchar(30),stu_id varchar(18),stu_tele varchar(20),stu_email varchar(30))"; $result=mysql_query($createtable) or die('
資料表建立失敗:'.mysql_error()); //選擇資料庫 mysql_select_db(mis_stu); if(!empty($_POST['reg_name'])) { $name=$_POST['reg_name']; $sex=$_POST['reg_sex']; $age=$_POST['reg_age']; $class=$_POST['reg_class']; $id=$_POST['reg_id']; $tele=$_POST['reg_tele']; $email=$_POST['reg_email']; //定義插入資料到stu_reg表中的SQL字串 mysql_query("set names gb2312"); $SQL="insert into stu_reg(stu_name,stu_sex,stu_age,stu_class,stu_id,stu_tele,stu_email) values ('$name','$sex','$age','$class','$id','$tele','$email')"; mysql_query($SQL); mysql_query("COMMIT"); echo "恭喜您,註冊成功!
輸入以下內容登陸系統查詢註冊資訊
"; } mysql_close($link); ?> 登入前請先註冊

資訊查詢登入

>

新生入學需知:

請各位同學先到各個學院完善註冊資訊,
做好報道註冊工作,
同時按要求完善電子檔案資訊。

希望廣大同學儘快適應新環境,
認識新朋友,儘快投入到學習工作當中!

教務處電話:12345678
保衛科電話:87654321

(3)、查詢資訊顯示模組(stu_info.php)

基本資料   <?php    if($_POST['log_name']=='')    {      echo "姓名不可為空!請重新輸入!
"; echo "重新登入"; } else { $link = mysql_connect('localhost','root','Dongsheng'); if(!$link) { echo "與資料庫連接失敗!"; die('Could not connect: ' .mysql_error()); } $result=mysql_select_db(mis_stu) or die('選擇mis_stu資料庫失敗:'.mysql_error()); mysql_query("set names gb2312"); $slt=mysql_query("select * from stu_reg"); $arr=mysql_fetch_assoc($slt); $flag=0; while($arr) { if($_POST['log_name']==$arr['stu_name']) { $flag=1; if($_POST['log_id']==$arr['stu_id']) { echo "登入成功,您的基本資料為:

"; echo "姓名:".$arr['stu_name']."
"; echo "性別:".$arr['stu_sex']."
"; echo "年齡:".$arr['stu_age']."
"; echo "班級:".$arr['stu_class']."
"; echo "社會安全號碼:".$arr['stu_id']."
"; echo "聯絡電話:".$arr['stu_tele']."
"; echo "電子郵件:".$arr['stu_email']."
"; break; } else { echo "密碼錯誤!請重新輸入。
"; break; } } $arr=mysql_fetch_assoc($slt); } if($flag==0) echo "對不起!您查詢的使用者不存在,請先返回註冊
"; mysql_close($link); echo "切換使用者
"; } ?>

您可能感興趣的文章:

  • php註冊登入系統簡化版
  • 超詳細的php使用者註冊頁面填寫資訊完整執行個體(附源碼)
  • php使用者註冊資訊驗證Regex
  • PHP製作使用者註冊系統
  • php使用者註冊時常用的檢驗函數執行個體總結
  • PHP+jQuery 註冊模組開發詳解
  • PHP+Ajax檢測使用者名稱或郵件註冊時是否已經存在執行個體教程
  • ThinkPHP之使用者註冊登入留言完整執行個體
  • 註冊頁面之前先驗證使用者名稱是否存在的php代碼
  • PHP+AJAX實現無重新整理註冊(帶使用者名稱即時檢測)

http://www.bkjia.com/PHPjc/1113730.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1113730.htmlTechArticlePHP編寫學校網站上新生註冊登陸程式的執行個體分享,php執行個體 就弄了三個頁面: (1)、新生資訊註冊模組(register.php): !DOCTYPE HTML PUBLIC "-//W3...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.