[PHP] 纯文本查看 复制代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>PHP与Web表单的综合应用</title>
<style type="text/css">
<!--
body,td,th {
font-size: 14px;
}
body {
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
}
.submit{
padding:5px;
width:90px;
font-size:17px;
background:#DCDCDC;
border:0px;
}
-->
</style></head>
<body style="margin:0px auto;width:1080px;">
<form action="index.php" method="post" name="form1" enctype="multipart/form-data">
<div style="width:600px;">
<table width="600" height="500" border="1" cellpadding="1" cellspacing="1" bordercolor="#AED0EA" style="display:table;">
<tr bgcolor="#D7EBF9">
<td width="103" height="25" align="right">姓名:</td>
<td height="25" align="left"><input name="user" type="text" id="user" size="20" maxlength="100"></td>
</tr>
<tr bgcolor="#D7EBF9">
<td height="25" align="right">性别:</td>
<td height="25" align="left"><input name="sex" type="radio" value="男" checked>
男
<input type="radio" name="sex" value="女">
女</td>
</tr>
<tr bgcolor="#D7EBF9">
<td width="103" height="25" align="right">密码:</td>
<td width="289" height="25" align="left"><input name="pwd" type="password" id="pwd" size="20" maxlength="100"></td>
</tr>
<tr bgcolor="#D7EBF9">
<td height="25" align="right">学历:</td>
<td height="25" align="left"><select name="select">
<option value="初中">初中</option>
<option value="高中">高中</option>
<option value="专科">专科</option>
<option value="本科" selected>本科</option>
<option value="研究生">研究生</option>
<option value="博士生">博士生</option>
<option value="硕士生">硕士生</option>
</select></td>
</tr>
<tr bgcolor="#D7EBF9">
<td height="25" align="right">爱好:</td>
<td height="25" align="left"><input name="fond[]" type="checkbox" value="电脑"/>
电脑
<input name="fond[]" type="checkbox" value="音乐"/>
音乐
<input name="fond[]" type="checkbox" value="旅游"/>
旅游
<input name="fond[]" type="checkbox" value="其他"/>
其他</td>
</tr>
<tr bgcolor="#D7EBF9">
<td height="25" align="right">个人头像: </td>
<td height="25" align="left"><input name="photo" type="file" size="20" maxlength="1000" id="photo"></td>
</tr>
<tr bgcolor="#D7EBF9">
<td height="25" align="right">个人简介: </td>
<td height="25" align="left"><textarea name="intro" cols="28" rows="4" id="intro"></textarea></td>
</tr>
<tr align="center" bgcolor="#D7EBF9">
<td height="25" colspan="2"><input type="submit" name="submit" value="提交" class="submit"/>
<input type="reset" name="submit2" value="重置" class="submit"></td>
</tr>
</table>
</div>
</form>
<div style="font-size:18px;">
<?php
if(isset($_POST['user']) !=null && $_POST['user']!=""){
echo "您的个人简历内容是:";
echo "<br/>";
echo " 姓名:".$_POST['user'];
echo "<br/>";
echo " 性别:".$_POST['sex'];
echo "<br/>";
echo " 密码:".$_POST['pwd'];
echo "<br/>";
echo " 学历:".$_POST['select'];
echo "<br/>";
echo " 爱好:";
for($i=0;$i<count($_POST['fond']);$i++){
echo $_POST['fond'][$i]." ";
}
echo "<br/>";
$path = './upfiles/'. $_FILES['photo']['name'];
move_uploaded_file($_FILES['photo']['tmp_name'],$path);
echo "个人头像:".$path;
echo "<br/>";
echo " 个人简介:".$_POST['intro'];
}
?>
</div>
</body>
</html>