当前位置: 首页 > 图文教程 > 网络编程 > PHP > PHP+DBM的同学录程序(3)

PHP
MYSQL版本大于4.1问题 - PHPchina
怎么让用户点击一个连接后,把一个图片另存了 - PHPchina
武汉10月15日Phper聚会召集!!! - PHPchina
php如果不等待exec执行的程序创建的子进程? - PHPchina
哪位知道DISCUZ处理防SQL注入的代码是哪部分 - PHPchina
求教!我实在不知道哪里问题,在线等ing - PHPchina
怎样结束用户某一进程 - PHPchina
比对用户名密码能不能这样写? - PHPchina
求助:如何在PHP+mysql中实现数据备份? - PHPchina
大家看看这个配置对吗 - PHPchina
如何禁止require当前文件 - PHPchina
无法将回调函数放在类中? - PHPchina
村里 PHP代码高亮是怎么实现的? - PHPchina
apache安装后.服务里没有apache2这个服务! - PHPchina
请教一个小问题 - PHPchina
config.php里面是不是应该把多数参数设置为常量而不是变量? - PHPchina
请教高手一个问题 - PHPchina
如何让百度收录我的网站 ?? - PHPchina
谁能给个注入的简单语句? - PHPchina
求PHP站内搜索思路 - PHPchina

PHP+DBM的同学录程序(3)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 71 ::
收藏到网摘: n/a

6、登出文件logout.php3
<?
setcookie("login",false,time()+31536000);
header("location:login.php3");
?>
7、修改信息文件modify.php3
<?
require("common.php3");
$id=$login;
if($submit){
if($name=="")error("请填写您的名字!");
elseif($mail=="")error("请填写您的邮件地址!");
else{
$dbm=dbmopen("class","w");
$intro=nl2br($intro);
$data="$name|!:!|$nickname|!:!|$mail|!:!|$home|!:!|$oicq|!:!|$icq|!:!|$add|!:!|$tel|!:!|$birth|!:!|$job|!:!|$intro|!:!|$sex";
dbmreplace($dbm,$id,$data);
dbmclose($dbm);
header("Location:index.php3");
}
}else{
$dbm=dbmopen("class","r");
$data=dbmfetch($dbm,$login);
$info=explode("|!:!|",$data);
dbmclose($dbm);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>同学录用户修改信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link rel="stylesheet" href="style.css">
</HEAD><BODY bgcolor="#FFFFFF" topMargin=0>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%"><BR>
<DIV align=center></DIV><CENTER><TBODY></TBODY></center>
</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="60%" align="center">
<TBODY> <TR vAlign=top>
<TD bgColor=#000000 width="100%" height="336">
<DIV align=center>
<TABLE border=0 cellPadding=4 cellSpacing=1 height=390 width=586>
<TBODY>
<TR>
<TD align=middle bgColor=#2f5e8c colSpan=2 height=14 vAlign=top><form method="POST" action="modify.php3"> <FONT color=#ffffff>修改信息-同学录<?echo$login;?></FONT></TD>
</TR>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>NickName: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=20 name=nickname size=23 value=<?echo$info[1];?>>
</td>
</tr>
<TR>
<TD align=middle bgColor=#ffffff height=25 width=121>电子邮件: </TD>
<TD align=left bgColor=#ffffff height=25 width=486>
<INPUT class=stedit maxLength=30 name=mail size=23 value=<?echo$info[2];?>>
*必须填写 </TD>
</TR>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的OICQ: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=9 name=oicq size=23 value=<?echo$info[4];?>>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的主页: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=50 name=home size=23 value="<?echo$info[3];?>">
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的 ICQ: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=10 name=icq size=23 value=<?echo$info[5];?>>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的名字: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=10 name=name size=23 value=<?echo$info[0];?>>
*必须填写 </td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的电话: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=20 name=tel size=23 value=<?echo$info[7];?>>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>出生日期: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=11 name=birth size=23 value=<?echo$info[8];?>>
*类似2000-10-10 </td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>联系地址: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<input class=stedit maxlength=50 name=add size=23 value=<?echo$info[6];?>>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的职业: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<select name="job">
<option value="学 生">学 生</option>
<option value="老 师">老 师</option>
<option value="其 他">其 他</option>
</select>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>您的性别: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<select name="sex">
<option value="俊 男">俊 男</option>
<option value="靓 女">靓 女</option>
<option value="其 他">其 他</option>
</select>
</td>
</tr>
<tr>
<td align=middle bgcolor=#ffffff height=25 width=121>个人简介: </td>
<td align=left bgcolor=#ffffff height=25 width=486>
<textarea class="stedit" name="intro" cols="40" rows="4"><?echo$info[10];?></textarea>
</td>
</tr>
<TR bgColor=#ffedc8>
<TD bgColor=#ffffff colSpan=2>
<div align="center">
<input type="submit" name="submit" value="确认修改" class="stbtm">