php實(shí)訓(xùn)鑒定表個(gè)人總結(jié).doc_第1頁
php實(shí)訓(xùn)鑒定表個(gè)人總結(jié).doc_第2頁
php實(shí)訓(xùn)鑒定表個(gè)人總結(jié).doc_第3頁
已閱讀5頁,還剩10頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、php實(shí)訓(xùn)鑒定表個(gè)人總結(jié)PHP實(shí)訓(xùn)報(bào)告煙臺(tái)南山學(xué)院工學(xué)院計(jì)算機(jī)系PHP程序設(shè)計(jì)課程設(shè)計(jì)報(bào)告20212021學(xué)年春季學(xué)期班姓學(xué)專級(jí):軟件141名:號(hào):201業(yè):軟件141指導(dǎo)教師:日期課程設(shè)計(jì)目的2021662021610地點(diǎn)68#E309該課程的考查目標(biāo)是檢驗(yàn)學(xué)生掌握PHP程序設(shè)計(jì)的理論知識(shí)和技能。經(jīng)過PHP程序設(shè)計(jì)的課程設(shè)計(jì)后學(xué)生應(yīng)具備應(yīng)用Zendstudio10.6.1做PHP簡(jiǎn)單項(xiàng)目的能力以及靈活運(yùn)用所學(xué)的知識(shí)、方法與技巧解決實(shí)際問題的綜合能力。課程設(shè)計(jì)要求:1、課程設(shè)計(jì)期間每天登記考勤作為課程設(shè)計(jì)成績(jī)的一部分。2、課程設(shè)計(jì)期間不能玩游戲、看電影、小說等做與學(xué)習(xí)無關(guān)的事。如果有不遵守的同

2、學(xué)將取消當(dāng)天成績(jī)。3、每天必須按照指導(dǎo)教師課程設(shè)計(jì)安排完成當(dāng)天的項(xiàng)目并經(jīng)過老師的檢查。4、完成整個(gè)課程設(shè)計(jì)以后要求每人寫出課程設(shè)計(jì)報(bào)告。5、課程設(shè)計(jì)報(bào)告要求有插圖模塊關(guān)鍵代碼及注釋。課程設(shè)計(jì)內(nèi)容:實(shí)驗(yàn)一用戶注冊(cè)系統(tǒng)的實(shí)現(xiàn)功能介紹用戶注冊(cè)系統(tǒng)是WEB系統(tǒng)中功能較為簡(jiǎn)單的系統(tǒng)該系統(tǒng)為瀏覽器用戶提供用戶注冊(cè)功能和用戶登錄功能。在用戶登錄界面中包括登錄與注冊(cè)兩個(gè)按鈕登錄時(shí)登錄成功顯示提示信息;登錄錯(cuò)誤顯示錯(cuò)誤信息并且通過超鏈返回登錄頁面。在用戶注冊(cè)界面中可以填寫注冊(cè)信息進(jìn)行注冊(cè)注冊(cè)成功提示成功信息;注冊(cè)失敗提示對(duì)應(yīng)錯(cuò)誤信息(例如:用戶名被占用、密碼錯(cuò)誤等)。數(shù)據(jù)庫(kù)中包括一張表即可表的設(shè)置隨意。實(shí)驗(yàn)步驟

3、:1.驗(yàn)證用戶注冊(cè)界面的實(shí)現(xiàn)(register.php)<h1用戶注冊(cè)界面</h1<formmethod=“post”action=“register_pro.php”用戶名:<inputtype=“text”name=“username”maxlength=“12”value=“0-6個(gè)字符”<selectname=“email”<optionvalue=“163.”selected163.</option<optionvalue=“qq.”qq.</option<optionvalue=“sina.”sina.</optio

4、n</select<br密碼:<inputtype=“password”name=“password”maxlength=“15”<br/確認(rèn)密碼:<inputtype=“password”name=“confirmpassword”size=“20”maxlength=“15”/<br/選擇性別:<inputname=“sex”type=“radio”value=“male”checked/男<inputname=“sex”type=“radio”value=“female”/女<br/個(gè)人愛好:<inputname=“intere

5、sts”type=“checkbox”value=“music”checked/音樂<inputname=“interests”type=“checkbox”value=“game”/游戲<inputname=“interests”type=“checkbox”value=“film”/電影<br/備注信息:<textareaname=“remark”cols=“30”rows=“10”請(qǐng)?zhí)顚憘渥⑿畔?lt;/textarea<br/<inputtype=“submit”name=“submit1”value=“注冊(cè)”/<inputtype=“rese

6、t”name=“cancel”value=“重新填寫”/</form2.用戶注冊(cè)功能的實(shí)現(xiàn)(register_pro.php)<?phpinclude_once(“functions/database.php”);$password=$_POSTpassword;$confirmpassword=$_POSTconfirmpassword;if($password!=$confirmpassword)exit(“輸入的密碼和確認(rèn)密碼不相等!”);$userName=$_POSTusername;$email=$_POSTemail;$userName=$userName.$emai

7、l;$userNameSQL=“select_fromuserswhereuserName=$userName”;getConnection;$resultSet=mysql_query($userNameSQL);if(mysql_num_rows($resultSet)0)closeConnection;exit(“用戶名已經(jīng)被占用請(qǐng)更換其它用戶名!”);$sex=$_POSTsex;if(empty($_POSTinterests)$interests=“”;else$interests=implode(“;”,$_POSTinterests);$remark=$_POSTremark;

8、$registerSQL=“insertintousersvalues(null,$userName,$password,$sex,$interests,$remark)”;mysql_query($registerSQL);$userID=mysql_insert_id;echo“用戶信息成功注冊(cè)!<br/”;$userSQL=“select_fromuserswhereuser_id=$userID”;$userResult=mysql_query($userSQL);if($user=mysql_fetch_array($userResult)echo“您已成功注冊(cè)您注冊(cè)的用戶名為

9、:”.$user“userName”;elseexit(“用戶信息注冊(cè)失敗!”);closeConnection;<inputtype=“button”value=“返回登陸界面”onclick=“window.location.href=login.php”3.用戶登錄頁面的實(shí)現(xiàn)(login.php)<h2用戶登陸界面</h2<formaction=“l(fā)ogin_pro.php”method=“post”用戶名:<inputtype=“text”name=“userName”value=“請(qǐng)?zhí)顚懹脩裘坝蛎?<br/登錄密碼:<inputtype=

10、“password”name=“password”size=“20”maxlength=“15”/<br/<inputtype=“submit”value=“登錄”/<inputtype=“button”value=“注冊(cè)”onclick=“window.location.href=register.php”</form4.用戶登錄功能的簡(jiǎn)單實(shí)現(xiàn)(login_pro.php)<?phpinclude_once(“functions/database.php”);$userName=$_POSTuserName;$password=$_POSTpassword;ge

11、tConnection;$sql=“select_fromuserswhereuserName=$userNameandpassword=$password”;$resultSet=mysql_query($sql);if(mysql_num_rows($resultSet)0)echo“您已成功登錄!”;elseecho“用戶名和密碼輸入錯(cuò)誤!”;closeConnection;<inputtype=“button”value=“返回登陸界面”onclick=“window.location.href=login.php”5.數(shù)據(jù)庫(kù)相關(guān)函數(shù)(function/database.php)

12、<?php$databaseConnection=null;functiongetConnection$hostname=“l(fā)ocalhost”;$database=“register”;$username=“root”;$password=“root”;global$databaseConnection;$databaseConnection=mysql_connect($hostname,$username,$password)ordie(mysql_error);mysql_query(“setnamesgbk”);mysql_select_db($database,$databa

13、seConnection)ordie(mysql_error);functioncloseConnectionglobal$databaseConnection;if($databaseConion)mysql_close($databaseConnection)ordie(mysql_error);6、數(shù)據(jù)庫(kù)代碼建立register數(shù)據(jù)庫(kù)以及users表。usetest;createdatabaseregister;useregister;createtableusers(user_idintAUTO_INCREMENTprimarykey,userNamevarchar(15)notnul

14、l,passwordvarchar(15)notnull,sexchar(2)notnull,interestschar(5)notnull,remarkvarchar(100);實(shí)驗(yàn)結(jié)果:1.用戶注冊(cè)界面2.返回注冊(cè)結(jié)果3.用戶登陸界面4.返回登陸信息實(shí)驗(yàn)二雇員管理系統(tǒng)功能介紹數(shù)據(jù)庫(kù)中至少包括兩張表(雇員表管理員表)。首先是登錄界面如果登錄成功則跳轉(zhuǎn)到主界面;如果登錄失敗則提示對(duì)應(yīng)的失敗信息。其次在主界面中包括管理用戶、添加用戶、查詢用戶、退出系統(tǒng)點(diǎn)擊管理用戶進(jìn)入雇員管理界面在該界面下可以對(duì)所有的用戶進(jìn)行刪除與修改(盡量實(shí)現(xiàn)分頁功能);點(diǎn)擊添加用戶可以對(duì)用戶進(jìn)行添加;點(diǎn)擊查詢用戶可以對(duì)用戶進(jìn)

15、行查詢;點(diǎn)擊退出系統(tǒng)則系統(tǒng)退出。最后把雇員管理系統(tǒng)進(jìn)行美化及代碼優(yōu)化(根據(jù)個(gè)人情況隨意制作)。實(shí)驗(yàn)步驟:1、數(shù)據(jù)庫(kù)底層設(shè)計(jì)showvariablesliketable_type;SETcharacter_set_client=gbk;SETcharacter_set_connection=gbk;SETcharacter_set_database=gbk;SETcharacter_set_results=gbk;SETcharacter_set_server=gbk;SETcollation_connection=gbk_chinese_ci;SETcollation_database=gbk

16、_chinese_ci;SETcollation_server=gbk_chinese_ci;showvariableslikecharacter%;showvariableslikecollation%;usetest;createtablemanage(manage_idintprimarykeyauto_increment,mNamechar(50)notnullunique,passwordchar(10)notnull);createtableusers(user_idintprimarykeyauto_increment,userNamechar(50)notnullunique,

17、gradeint,emailchar(50),Salaryint);createtableadmin(idintprimarykey,namevarchar(32)notnull,passwordvarchar(128)notnull);insertintoadminvalues(201,tony,123456);insertintoadminvalues(202,jack,56789);insertintoadminvalues(203,tom,1234565);createtableemp(idintprimarykeyauto_increment,namevarchar(64)notnu

18、ll,gradetinyint,emailvarchar(64)notnull,salaryfloat);insertintoempvalues(301,aaa,1,aaaa.,5000.0);insertintoempvalues(302,bbb,2,bbaa.,6000.0);insertintoempvalues(303,ccc,3,cccc.,7000.0);insertintoempvalues(304,ddd,4,ddaa.,5000.0);insertintomanagevalues(001,zhang,123456);insertintousersvalues(,zhangsa

19、n,80,12322.,3000);insertintousersvalues(102,lisi,85,19322.,3500);insertintousersvalues(103,wangwu,75,12522.,4000);insertintousersvalues(104,zhaoliu,90,59555.,5000);insertintousersvalues(105,fengqi,95,1ss22.,8000);2、登錄界面的實(shí)現(xiàn)<<head<meta-equiv=“content-type”content=“text/;charset=utf-8”</hea

20、d<h1管理員登陸系統(tǒng)</h1<formaction=“l(fā)ogin_process.php”method=“post”<table<tr<td用戶id</td<td<inputtype=“text”name=“id”</td</tr<tr<td密&;nbsp;碼</td<td<inputtype=“password”name=“password”</td</tr<tr<td<inputtype=“submit”value=“用戶登陸”</td<td<i

21、nputtype=“reset”value=“重新填寫”</td</tr</table</form<?phpif(!empty($_GETerrno)$errno=$_GETerrno;if($errno=1)echo“<br/<fontcolor=redsize=3你的用戶名或者密碼錯(cuò)誤!</font”;</<<head<meta-equiv=“content-type”content=“text/;charset=utf-8”</head<h1管理員登陸系統(tǒng)</h1<formaction=“l(fā)o

22、gin_process.php”method=“post”<table<tr<td用戶id</td<td<inputtype=“text”name=“id”</td</tr<tr<td密&;nbsp;碼</td<td<inputtype=“password”name=“password”</td</tr<tr<td<inputtype=“submit”value=“用戶登陸”</td<td<inputtype=“reset”value=“重新填寫”</td<

23、/tr</table</form<?phpif(!empty($_GETerrno)$errno=$_GETerrno;if($errno=1)echo“<br/<fontcolor=redsize=3你的用戶名或者密碼錯(cuò)誤!</font”;</3、主界面的實(shí)現(xiàn)<<head<meta-equiv=“content-type”content=“text/;charset=utf-8”</head<body<?phpecho“用戶”.$_GETname.“登陸成功!”;echo“<ahref=login.php返回

24、原頁面</a”;<h1主界面</h1<ahref=emplist.php管理用戶</a<br/<ahref=添加用戶</a<br/<ahref=查詢用戶</a<br/<ahref=退出系統(tǒng)</a<br/</body</4、雇員管理界面<<head<meta-equiv=“content-type”content=“text/;charset=utf-8”<scripttype=“text/javascript”functionconfirmDele(val)return

25、window.confirm(“是否要?jiǎng)h除id=”+val+“的用戶”);</script</head<body<?phprequire_once(“functions/database.php”);$id=$_GETid;getConnection;$sql=“deletefromempwhereid=$id”;mysql_query($sql);$pageCount=0;/共有幾頁$pageSize=6;/每頁顯示幾條$pageNow=1;/顯示第幾頁if(!empty($_GETpageNow)$pageNow=$_GETpageNow;$rowCount=0;/共有幾條記錄$sql1=“selectcount(id)fromemp”;$res1=mysql_query($sql1);if($row=mysql_fetch_row($res1)/取出行數(shù)$rowCount=$row0;$pageCount=ceil($rowCount

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論