PHP+DBM的同学录程序(5)
程序员文章站
2022-03-04 16:00:27
10、会员信息显示文件show.php3 if($login){ require("common.php3"); if(!isset($id...
10、会员信息显示文件show.php3
<?
if($login){
require("common.php3");
if(!isset($id))error("怎么没有填写用户的id?");
else{
$id=chop($id);
$dbm=dbmopen("class","r");
if(!dbmexists($dbm,$id))error("没有这个用户id!");
else{
$data=dbmfetch($dbm,$id);
$info=explode("|!:!|",$data);
$name=$info[0]; $nickname=$info[1]; $mail=$info[2]; $home=$info[3]; $oicq=$info[4];
$icq=$info[5]; $add=$info[6]; $tel=$info[7]; $birth=$info[8]; $job=$info[9];
$intro=$info[10]; $sex=$info[11];
}
dbmclose($dbm);
}
?>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head><title>查 看 <?echo$name?> 的 资 料</title>
<meta content="text/html; charset=gb2312" http-equiv=content-type>
<style type=text/css>a {
color: #336699; font-family: "宋体"; font-size: 9pt; text-decoration: none
}
a:hover {
color: #ff0000; font-family: "宋体"; font-size: 9pt; text-decoration: underline
}
body {
font-family: "宋体", "serif"; font-size: 9pt
}
td {
font-family: "宋体", "serif"; font-size: 9pt
}
input {
font-size: 9pt
}
p {
font-size: 9pt
}
br {
font-size: 9pt
}
tr {
font-size: 9pt
}
table {
font-size: 9pt
}
input {
font-family: arial,宋体; font-size: 9pt; padding-top: 3px
}
input.text {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
input.file {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
select {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
textarea {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
.stedit {
border-bottom: #000066 1px solid; border-left: #4a3163 1px solid; border-right: #4a3163 1px solid; border-top: #4a3163 1px solid; font-size: 9pt
}
.stbtm {
border-bottom: #665b8e 1px solid; border-left: #ffffff 1px solid; border-right: #665b8e 1px solid; border-top: #ffffff 1px solid; color: #000000; font-size: 9pt; height: 20px
}
.ddd {
color: #ffffff; filter: glow(color=black,strength=1); font-size: 9pt; line-height: 13pt; position: relative; width: 100%
}
</style></head><body bgcolor=#333366>
<div align=center><table bgcolor=#000000 border=0 cellpadding=8 cellspacing=1 height=312
width="80%"><center>
<tr>
<td align=middle bgcolor=#b2b2b2 colspan=2 height=6>
<p align=center><?echo$name?>的详细资料 </p>
</td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=6 width="34%">姓名</td>
<td align=left bgcolor=#dedfdf height=6 width="66%"><?echo$name?> </td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12
width="34%">nickname</td>
<td align=middle bgcolor=#dedfdf height=12 width="66%">
<p align=left><?echo$nickname?></p>
</td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">性别</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$sex?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">邮件地址</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$mail?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">个人主页</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><a href=<?echo$home?>><?echo$home?></a></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">目前职业</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$job?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=14 width="34%">oicq号码</td>
<td align=left bgcolor=#dedfdf height=14 width="66%">
<?
if($oicq=="")echo "不告诉你!";
else{
?>
<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<?echo$oicq?>" target=_blank title=<?echo$name?>的oicq号码是<?echo$oicq?>,点击查看资料><img border=0 height=16 src="http://infocenter.tencent.com/<?echo$oicq?>/l/00/0/" width=16> <?echo$oicq?></a>
<?
}
?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">icq 号码</td>
<td align=left bgcolor=#dedfdf height=12 width="66%">
<?
if($oicq=="")echo "不告诉你!";
else{
?><img src=http://wwp.icq.com/scripts/online.dll?icq=<?echo$icq;?>&img=7><?echo$icq?>
<?
}?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">生日日期</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$birth?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">联系地址</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$add?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">联系电话</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$tel?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">个人简介</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$intro?></td>
</tr>
</center>
</table>
</div></body></html>
<?
}else header("location:login.php3");
?>
11、css文件:
a {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
a:hover {text-decoration: underline; color: #ff0000; font-family: "宋体"; font-size: 9pt}
body { font-family: "宋体", "serif"; font-size: 9pt}
td { font-family: "宋体", "serif"; font-size: 9pt}
input { font-size: 9pt}
p { font-size: 9pt}
br { font-size: 9pt}
tr { font-size: 9pt}
table { font-size: 9pt}
input { font-family: arial,宋体; font-size: 9pt; padding-top: 3px }
input.text {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
input.file {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
select {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
textarea {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
.stedit { font-size: 9pt; border-left: 1px solid #4a3163;
border-right: 1px solid #4a3163; border-top: 1px solid #4a3163;
border-bottom: 1px solid #000066 }
.stbtm { background-color: #cococo; color: #000000; font-size: 9pt; height: 20px;
border-left: 1px solid #ffffff; border-right: 1px solid #665b8e;
border-top: 1px solid #ffffff; border-bottom: 1px solid #665b8e }
好了,完了
<?
if($login){
require("common.php3");
if(!isset($id))error("怎么没有填写用户的id?");
else{
$id=chop($id);
$dbm=dbmopen("class","r");
if(!dbmexists($dbm,$id))error("没有这个用户id!");
else{
$data=dbmfetch($dbm,$id);
$info=explode("|!:!|",$data);
$name=$info[0]; $nickname=$info[1]; $mail=$info[2]; $home=$info[3]; $oicq=$info[4];
$icq=$info[5]; $add=$info[6]; $tel=$info[7]; $birth=$info[8]; $job=$info[9];
$intro=$info[10]; $sex=$info[11];
}
dbmclose($dbm);
}
?>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head><title>查 看 <?echo$name?> 的 资 料</title>
<meta content="text/html; charset=gb2312" http-equiv=content-type>
<style type=text/css>a {
color: #336699; font-family: "宋体"; font-size: 9pt; text-decoration: none
}
a:hover {
color: #ff0000; font-family: "宋体"; font-size: 9pt; text-decoration: underline
}
body {
font-family: "宋体", "serif"; font-size: 9pt
}
td {
font-family: "宋体", "serif"; font-size: 9pt
}
input {
font-size: 9pt
}
p {
font-size: 9pt
}
br {
font-size: 9pt
}
tr {
font-size: 9pt
}
table {
font-size: 9pt
}
input {
font-family: arial,宋体; font-size: 9pt; padding-top: 3px
}
input.text {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
input.file {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
select {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
textarea {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
.stedit {
border-bottom: #000066 1px solid; border-left: #4a3163 1px solid; border-right: #4a3163 1px solid; border-top: #4a3163 1px solid; font-size: 9pt
}
.stbtm {
border-bottom: #665b8e 1px solid; border-left: #ffffff 1px solid; border-right: #665b8e 1px solid; border-top: #ffffff 1px solid; color: #000000; font-size: 9pt; height: 20px
}
.ddd {
color: #ffffff; filter: glow(color=black,strength=1); font-size: 9pt; line-height: 13pt; position: relative; width: 100%
}
</style></head><body bgcolor=#333366>
<div align=center><table bgcolor=#000000 border=0 cellpadding=8 cellspacing=1 height=312
width="80%"><center>
<tr>
<td align=middle bgcolor=#b2b2b2 colspan=2 height=6>
<p align=center><?echo$name?>的详细资料 </p>
</td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=6 width="34%">姓名</td>
<td align=left bgcolor=#dedfdf height=6 width="66%"><?echo$name?> </td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12
width="34%">nickname</td>
<td align=middle bgcolor=#dedfdf height=12 width="66%">
<p align=left><?echo$nickname?></p>
</td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">性别</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$sex?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">邮件地址</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$mail?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">个人主页</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><a href=<?echo$home?>><?echo$home?></a></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">目前职业</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$job?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=14 width="34%">oicq号码</td>
<td align=left bgcolor=#dedfdf height=14 width="66%">
<?
if($oicq=="")echo "不告诉你!";
else{
?>
<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<?echo$oicq?>" target=_blank title=<?echo$name?>的oicq号码是<?echo$oicq?>,点击查看资料><img border=0 height=16 src="http://infocenter.tencent.com/<?echo$oicq?>/l/00/0/" width=16> <?echo$oicq?></a>
<?
}
?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">icq 号码</td>
<td align=left bgcolor=#dedfdf height=12 width="66%">
<?
if($oicq=="")echo "不告诉你!";
else{
?><img src=http://wwp.icq.com/scripts/online.dll?icq=<?echo$icq;?>&img=7><?echo$icq?>
<?
}?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">生日日期</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$birth?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">联系地址</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$add?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">联系电话</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$tel?></td>
</tr>
<tr>
<td align=middle bgcolor=#dedfdf height=12 width="34%">个人简介</td>
<td align=left bgcolor=#dedfdf height=12 width="66%"><?echo$intro?></td>
</tr>
</center>
</table>
</div></body></html>
<?
}else header("location:login.php3");
?>
11、css文件:
a {text-decoration: none; color: #336699; font-family: "宋体"; font-size: 9pt}
a:hover {text-decoration: underline; color: #ff0000; font-family: "宋体"; font-size: 9pt}
body { font-family: "宋体", "serif"; font-size: 9pt}
td { font-family: "宋体", "serif"; font-size: 9pt}
input { font-size: 9pt}
p { font-size: 9pt}
br { font-size: 9pt}
tr { font-size: 9pt}
table { font-size: 9pt}
input { font-family: arial,宋体; font-size: 9pt; padding-top: 3px }
input.text {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
input.file {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
select {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
textarea {
background-color: #f0f0f0; border-bottom: #101010 1px solid; border-left: #101010 1px solid; border-right: #101010 1px solid; border-top: #101010 1px solid; color: #000000
}
.stedit { font-size: 9pt; border-left: 1px solid #4a3163;
border-right: 1px solid #4a3163; border-top: 1px solid #4a3163;
border-bottom: 1px solid #000066 }
.stbtm { background-color: #cococo; color: #000000; font-size: 9pt; height: 20px;
border-left: 1px solid #ffffff; border-right: 1px solid #665b8e;
border-top: 1px solid #ffffff; border-bottom: 1px solid #665b8e }
好了,完了
下一篇: 地址映射与共享
推荐阅读
-
HTML5页面嵌入小程序没有返回按钮及返回页面空白的问题
-
opencv 结合pyqt5 编写简单的图像处理GUI程序
-
程序员 - PHP时间问题,2014-1-21 和 2013-5-13 请用最有效率的方法计算出两个时间相差的年份和月份??
-
PHP+DBM的同学录程序(5)_PHP教程
-
13. 编写一个程序,提示用户输入3组数,每组数包含5个double类型的数(假设用户都正确地响 应,不会输入非数值数据)。该程序应完成下列任务。
-
20佳惊艳的HTML5应用程序示例分享
-
WinForm程序启动时不显示主窗体的5种方法
-
微信小程序开发用什么语言比较合适,开发者必须掌握的5个常见语言
-
微信小程序开发用什么语言比较合适,开发者必须掌握的5个常见语言
-
微信小程序 MD5的方法详解及实例代码