bsp; <input type='password' name='psw' size='8' maxlength='8' value="<? echo $psw; ?>">
*<br>
(英文字母或加数字,长度不超过8个字符)<br>
确认密码:
<input type='password' name='psw2' size='8' maxlength='8' value="<? echo $psw; ?>">
*<br>
姓名:
<input type='Text' name='name' size='8' maxlength='8' value="<? echo $name; ?>">
*<br>
性别:男
<input type='radio' name='sex' value='男' <? if ($sex=='男'){echo "checked";} ?>>
女
<input type='radio' name='sex' value='女' <? if ($sex=='女'){echo "checked";} ?>>
<br>
生日:<input type="text" name="birth" size="12" maxlength="12" value="<? echo $birth; ?>"><br>
工作单位:
<input type='Text' name='work' size='30' maxlength='50' value="<? echo $work; ?>">
<br>
通讯地址:
<input type='Text' name='ad' size='30' maxlength='50' value="<? echo $ad; ?>">
*<br>
邮编:
<input type='Text' name='post' size='6' maxlength='6' value="<? echo $post; ?>">
<br>
电话:
<input type='Text' name='ph' size='15' maxlength='30' value="<? echo $ph; ?>">
*<br>
传呼:
<input type='Text' name='bp' size='15' maxlength='20' value="<? echo $bp; ?>">
<br>
Email:
<input type='Text' name='email' size='15' maxlength='35' value="<? echo $email; ?>">
*<br>
oicq:
<input type='Text' name='oicq' size='12' maxlength='12' value="<? echo $oicq; ?>">
<br>
个人说明:(在通讯录里显示,不超过125个汉字)<BR>
<textarea name='account' cols='50' rows='5'><? echo $account; ?></textarea>
<br>
个人签名:(在留言簿的自动签名,不超过125个汉字)<br>
<textarea name="signature" cols="50" rows="5"><? echo $signature; ?></textarea>
</td>
<td height="153" width="40%"><br>
选择一个自己喜欢的头像:<br>
<?
for ($i=1;$i<=64;$i++){
echo "<img src='image/face/icon".$i.".gif' width='32' height='32'>";
echo "<input type='radio' name='face' value='$i' ";
if ($face==$i){
echo "checked";
}
echo ">";
if (($i%4)==0){ //隔4行,换行
echo "<br>";
}
}
?><br>
</td>
</tr>
</table>
<div align="center">
<br>
<input type='Submit' name='submit' value='提交'>
<input type='reset' name='Reset' value='重写 '>
</div>
</form>
</td>
</tr>
</table>
</BODY>
</HTML>
上传照片:class/uploadphoto.php
<?
session_start(); // 开始session
if(!session_is_registered("userregister")||($userregister==""))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo "<a href='../../index.php'>请重新注册<BR>";
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>上传照片</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
include "../config.php";
if ($upload){
if ($picurl=="none"){
echo "你没有上传任何文件.";
exit;
}
$v=opendir("image");
if ($v==0)
{ mkdir("image"); //若目录不存在,则新建一个
$v=opendir("image"); //取得目录handle
}
$up=copy("$picurl","image/$picurl_name");
if($up==1)
{
//初始化写入内容
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);//查询以往照片信息
$photo=mysql_result($result,0,'photo');
$photo=str_replace("'","'",$photo);//将'用'代替
$photo=$photo."<a href='upload/image/$picurl_name'>看照片</a>|";//加上此次内容
mysql_query("UPDATE user SET photo='$photo' where user='$userregister'",$db);//写入
mysql_close($db);
echo "文件上传成功!<BR>";
echo "文件名:$picurl_name 文件大小:$picurl_size byte 文件类型:$picurl_type<BR>";
}
else
{echo "文件上传失败.";exit;}
unlink ($picurl); //从临时文件夹中删除档案$picurl
closedir ($v); //关闭目录handle
exit;
}
?>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="56" width="32%"><img src="../image/classlogo.gif" width="224" height="60"></td>
<td height="56" width="68%">
<div align="center">上传照片</div>
</td>
</tr>
<tr>
<td height="108" colspan="2"><form action="<? echo $PHP_SELF;?>" method="pos
*<br>
(英文字母或加数字,长度不超过8个字符)<br>
确认密码:
<input type='password' name='psw2' size='8' maxlength='8' value="<? echo $psw; ?>">
*<br>
姓名:
<input type='Text' name='name' size='8' maxlength='8' value="<? echo $name; ?>">
*<br>
性别:男
<input type='radio' name='sex' value='男' <? if ($sex=='男'){echo "checked";} ?>>
女
<input type='radio' name='sex' value='女' <? if ($sex=='女'){echo "checked";} ?>>
<br>
生日:<input type="text" name="birth" size="12" maxlength="12" value="<? echo $birth; ?>"><br>
工作单位:
<input type='Text' name='work' size='30' maxlength='50' value="<? echo $work; ?>">
<br>
通讯地址:
<input type='Text' name='ad' size='30' maxlength='50' value="<? echo $ad; ?>">
*<br>
邮编:
<input type='Text' name='post' size='6' maxlength='6' value="<? echo $post; ?>">
<br>
电话:
<input type='Text' name='ph' size='15' maxlength='30' value="<? echo $ph; ?>">
*<br>
传呼:
<input type='Text' name='bp' size='15' maxlength='20' value="<? echo $bp; ?>">
<br>
Email:
<input type='Text' name='email' size='15' maxlength='35' value="<? echo $email; ?>">
*<br>
oicq:
<input type='Text' name='oicq' size='12' maxlength='12' value="<? echo $oicq; ?>">
<br>
个人说明:(在通讯录里显示,不超过125个汉字)<BR>
<textarea name='account' cols='50' rows='5'><? echo $account; ?></textarea>
<br>
个人签名:(在留言簿的自动签名,不超过125个汉字)<br>
<textarea name="signature" cols="50" rows="5"><? echo $signature; ?></textarea>
</td>
<td height="153" width="40%"><br>
选择一个自己喜欢的头像:<br>
<?
for ($i=1;$i<=64;$i++){
echo "<img src='image/face/icon".$i.".gif' width='32' height='32'>";
echo "<input type='radio' name='face' value='$i' ";
if ($face==$i){
echo "checked";
}
echo ">";
if (($i%4)==0){ //隔4行,换行
echo "<br>";
}
}
?><br>
</td>
</tr>
</table>
<div align="center">
<br>
<input type='Submit' name='submit' value='提交'>
<input type='reset' name='Reset' value='重写 '>
</div>
</form>
</td>
</tr>
</table>
</BODY>
</HTML>
上传照片:class/uploadphoto.php
<?
session_start(); // 开始session
if(!session_is_registered("userregister")||($userregister==""))//检查是否注册,如userregister未注册或session为空值,重新注册.
{
echo "<a href='../../index.php'>请重新注册<BR>";
exit;
}
?>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<TITLE>上传照片</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?php
include "../config.php";
if ($upload){
if ($picurl=="none"){
echo "你没有上传任何文件.";
exit;
}
$v=opendir("image");
if ($v==0)
{ mkdir("image"); //若目录不存在,则新建一个
$v=opendir("image"); //取得目录handle
}
$up=copy("$picurl","image/$picurl_name");
if($up==1)
{
//初始化写入内容
$result = mysql_query("SELECT * FROM user where user='$userregister'",$db);//查询以往照片信息
$photo=mysql_result($result,0,'photo');
$photo=str_replace("'","'",$photo);//将'用'代替
$photo=$photo."<a href='upload/image/$picurl_name'>看照片</a>|";//加上此次内容
mysql_query("UPDATE user SET photo='$photo' where user='$userregister'",$db);//写入
mysql_close($db);
echo "文件上传成功!<BR>";
echo "文件名:$picurl_name 文件大小:$picurl_size byte 文件类型:$picurl_type<BR>";
}
else
{echo "文件上传失败.";exit;}
unlink ($picurl); //从临时文件夹中删除档案$picurl
closedir ($v); //关闭目录handle
exit;
}
?>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="56" width="32%"><img src="../image/classlogo.gif" width="224" height="60"></td>
<td height="56" width="68%">
<div align="center">上传照片</div>
</td>
</tr>
<tr>
<td height="108" colspan="2"><form action="<? echo $PHP_SELF;?>" method="pos