DDR爱好者之家 Design By 杰米
文件列表。。文件内容。。
dbconn.php
userListt.php
editUser.php
editDo.php
detailUser.php
deleteUser.php
addUser.php
addDo.php
<dbconn.php>
<"localhost",'root','') or die('error:'.mysql_error()); mysql_select_db('hyxx',$con) or die('error:'.mysql_error()); mysql_query('set NAMES utf8'); "htmlcode"><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>会员信息列表</title> </head> <body> <table border="1" cellspacing="0" cellpadding="0" id="userList" align="center"> <tr align="center"> <td>id</td> <td>用户名</td> <td>密码</td> <td>性别</td> <td>年龄</td> <td>出生年月</td> <td>爱好</td> <td>注册时间</td> <td>最后登录时间</td> <td>操作</td> </tr> <"PRC"); //读数据。。。 $sql = "select * from user order by id asc"; $result = mysql_query($sql,$con); $userList = ''; while($rs = mysql_fetch_array($result)){ $userList[] = $rs; } // 循环用户列表 foreach ($userList as $user){ echo " <tr> <td> ".$user['id']."</td> <td> ".$user['username']."</td> <td> ".$user['password']."</td> <td> ".$user['sex']."</td> <td> ".$user['age']."</td> <td> ".date("Y-m-d",$user['birthday'])."</td> <td> ".$user['hobby']."</td> <td> ".date("Y-m-d",$user['add_time'])."</td> <td> ".date("Y-m-d",$user['last_login'])."</td> <td> <a href='addUser.php'>增</a> <a href='deleteUser.php".$user['id']."');\"> 删</a> <a href='editUser.php".$user['id']."');\"> 改</a> <a href='detailUser.php".$user['id']."');\"> 查</a> </td> </tr> "; } "htmlcode"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>编辑用户</title> </head> <body> <"PRC"); //读数据。。。 $sql = "select * from user where id=".$userId; $result = mysql_query($sql,$con); $user = mysql_fetch_array($result); "editDo.php" method="post"> <input type="hidden" name="user_id" value="<"/> <table width="444" border="1" align="center"> <tr> <td>用户名 </td> <td> <input type="text" name="user_name" size="10" value=<"password" name="password" size="10" value=<"radio" name="sex" value="男" <"checked=\"checked\"" "radio" name="sex" value="女" <"checked=\"checked\"" "text" name="age" size="3" value=<"Y",$user['birthday']); $birday_m=date("m",$user['birthday']); $birday_d=date("d",$user['birthday']); "birthday_y"> <option value="1980" <"selected=\"selected\""; "1981" <"selected=\"selected\""; "1982" <"selected=\"selected\""; "1983" <"selected=\"selected\""; "1984" <"selected=\"selected\""; "1985" <"selected=\"selected\""; "1986" <"selected=\"selected\""; "1987" <"selected=\"selected\""; "1988" <"selected=\"selected\""; "1989" <"selected=\"selected\""; "1990" <"selected=\"selected\""; "birthday_m"> <option value="1" <"selected=\"selected\""; "2" <"selected=\"selected\""; "3" <"selected=\"selected\""; "4" <"selected=\"selected\""; "5" <"selected=\"selected\""; "6" <"selected=\"selected\""; "7" <"selected=\"selected\""; "8" <"selected=\"selected\""; "9" <"selected=\"selected\""; "10" <"selected=\"selected\""; "11" <"selected=\"selected\""; "12" <"selected=\"selected\""; "birthday_d"> <option value="1" <"selected=\"selected\""; "2" <"selected=\"selected\""; "3" <"selected=\"selected\""; "4" <"selected=\"selected\""; "5" <"selected=\"selected\""; "6" <"selected=\"selected\""; "7" <"selected=\"selected\""; "8" <"selected=\"selected\""; "9" <"selected=\"selected\""; "10" <"selected=\"selected\""; "11" <"selected=\"selected\""; "12" <"selected=\"selected\""; "13" <"selected=\"selected\""; "14" <"selected=\"selected\""; "15" <"selected=\"selected\""; "16" <"selected=\"selected\""; "17" <"selected=\"selected\""; "18" <"selected=\"selected\""; "19" <"selected=\"selected\""; "20" <"selected=\"selected\""; "21" <"selected=\"selected\""; "22" <"selected=\"selected\""; "23" <"selected=\"selected\""; "24" <"selected=\"selected\""; "25" <"selected=\"selected\""; "26" <"selected=\"selected\""; "27" <"selected=\"selected\""; "28" <"selected=\"selected\""; "29" <"selected=\"selected\""; "30" <"selected=\"selected\""; "31" <"selected=\"selected\""; "text" name="hobby" size="44" value=<"profile" rows="10" cols="30" ><"2" align="center"><input type="submit" value="确定修改" /></td> </tr> </table> <p> </p> <p> </p> <p> </p> </form> </body> </html><editDo.php>
<"h"),date("m"),date("s"),date("m"),date("d"),date("Y")); $lastLoginTime=$addTime; $sql = "update user set username='$user_name',password='$password',sex='$sex',age='$age',birthday='$birthday',hobby='$hobby',profile='$profile' where id='$user_id'"; echo $sql; // 执行sql语句 mysql_query($sql,$con); // 获取影响的行数 $rows = mysql_affected_rows(); // 返回影响行数 // 如果影响行数>=1,则判断添加成功,否则失败 if($rows >= 1) { alert("编辑成功"); href("userListt.php"); }else{ alert("编辑失败"); // href("addUser.php"); } function alert($title){ echo "<script type='text/javascript'>alert('$title');</script>"; } function href($url){ echo "<script type='text/javascript'>window.location.href='$url'</script>"; } "htmlcode"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>查看用户明细</title> </head> <body> <"PRC"); //读数据。。。 $sql = "select * from user where id=".$userId; $result = mysql_query($sql,$con); $user = mysql_fetch_array($result); "444" border="1" align="center"> <tr> <td>用户ID </td> <td> <"男"; else if($user[sex]=='2') echo "女"; else "保密"; "Y",$user['birthday']);echo $birday_y."年"; $birday_m=date("m",$user['birthday']);echo $birday_m."月"; $birday_d=date("d",$user['birthday']);echo $birday_d."日"; "profile" rows="10" cols="30" readonly><"2" align="center"><a href="userListt.php" >返回用户列表</a></td> </tr> </table> <p> </p> <p> </p> <p> </p> </body> </html><deleteUser.php>
<"删除成功"); }else{ alert("删除失败"); } // 跳转到用户列表页面 href("userListt.php"); function delete($id,$con){ $sql = "delete from user where id='$id'"; // 执行删除 mysql_query($sql,$con); // 获取影响的行数 $rows = mysql_affected_rows(); // 返回影响行数 return $rows; } function alert($title){ echo "<script type='text/javascript'>alert('$title');</script>"; } function href($url){ echo "<script type='text/javascript'>window.location.href='$url'</script>"; } "htmlcode"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>新增用户</title> </head> <body> <form action="addDo.php" method="post"> <input type="hidden" name="user_id" value=" "/> <table width="444" border="1" align="center"> <tr> <td>用户名 </td> <td> <input type="text" name="user_name" size="10" /></td> </tr> <tr> <td>密码</td> <td> <input type="password" name="password" size="10" /></td> </tr> <tr> <td>性别</td> <td> <input type="radio" name="sex" value="男" checked="checked" /> 男<input type="radio" name="sex" value="女" /> 女 </td> </tr> <tr> <td>年龄</td> <td> <input type="text" name="age" size="3" /></td> </tr> <tr> <td>出生年月</td> <td> <select name="birthday_y"> <option value="1980">1980</option> <option value="1981">1981</option> <option value="1982">1982</option> <option value="1983">1983</option> <option value="1984">1984</option> <option value="1985">1985</option> <option value="1986">1986</option> <option value="1987">1987</option> <option value="1988">1988</option> <option value="1989">1989</option> <option value="1990">1990</option> </select> 年 <select name="birthday_m"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> </select> 月 <select name="birthday_d"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select> 日 </td> </tr> <tr> <td>爱好</td> <td> <input type="text" name="hobby" size="44" /></td> </tr> <tr> <td>个人简介</td> <td> <textarea name="profile" rows="10" cols="30"></textarea></td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="增加用户" /></td> </tr> </table> <p> </p> <p> </p> <p> </p> </form> </body> </html><addDo.php>
<"h"),date("m"),date("s"),date("m"),date("d"),date("Y")); $lastLoginTime=$addTime; $sql = "insert into user (username,password,sex,age,birthday,hobby,profile,add_time,last_login) ". "values('$user_name','$password','$sex','$age','$birthday','$hobby','$profile','$addTime','$lastLoginTime')"; echo $sql; // 执行sql语句 mysql_query($sql,$con); // 获取影响的行数 $rows = mysql_affected_rows(); // 返回影响行数 // 如果影响行数>=1,则判断添加成功,否则失败 if($rows >= 1){ alert("添加成功"); href("userListt.php"); }else{ alert("添加失败"); // href("addUser.php"); } function alert($title){ echo "<script type='text/javascript'>alert('$title');</script>"; } function href($url){ echo "<script type='text/javascript'>window.location.href='$url'</script>"; } ?>以上所述就是本文的全部内容了,希望大家能够喜欢。
请您花一点时间将文章分享给您的朋友或者留下评论。我们将会由衷感谢您的支持!
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米
暂无评论...
更新日志
2024年11月27日
2024年11月27日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]