求助,高手进来帮忙下,谢谢!
这个是用户资料的modify.php文件
需要用户修改自己的资料的用PHP写
1。先把用户原来的资料从member.txt读出来,读到下面的id,password,text文本框里等等
2。再修改读出来的信息,按提交键,覆盖掉原来的资料,保存到member.txt里
<?
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<body>
<table>
<tr><td colspan=2 align=center><b>Change Byeong Profile</b></td></tr>
<form name="form1" method="post" action="reg.php">
<tr><td width="98"><strong>ID</strong></td>
<td width="588"><? print "$visitor" ?></td></tr>
<tr><td><strong>Password</strong></td>
<td><input type="password" name="password1" id="password1" size="40"></td></tr>
<tr><td><strong>Re-Password</strong></td>
<td><input type="password" name="password2" id="password2" size="40"></td></tr>
<tr><td><strong>First Name</strong></td>
<td><input type="text" name="firstname" size="40"></td></tr>
<tr><td><strong>Last Name</strong></td>
<td><select name="state">
<option selected value="1">[Select State]</option>
<option value="2">Australia</option>
<option value="2">China</option>
</select>
</td></tr>
<tr>
<td height="24"><strong>Select Interest</strong></td>
<td><input type=checkbox name="example" value="1">Technology
<input type=checkbox name="example" value="2">Enterprise
<input type=checkbox name="example" value="3">Research
<input type=checkbox name="example" value="4">Government
<input type=checkbox name="example" value="5">People
<input type=checkbox name="example" value="6">Life Style
<input type=checkbox name="example" value="7">Opinion</td></tr>
<tr><td><strong>Question</strong></td>
<td><select name="q">
<option selected value="1">[Select Question]</option>
<option value="2">What was the name of your primary school?</option>
<option value="3">What is the street name where you born?</option>
<option value="4">What is your best friend name?</option>
<option value="5">What is your grand father's name?</option>
<option value="6">What is your grand mother's name?</option>
</select>
</td></tr>
<tr><td><strong>Answer</strong></td>
<td><input type="text" name="answer" size="38"></td></tr>
<td><input type="submit" name="Submit" value="Change Profile">
<a href="main.php?work=login" target="mainFrame" class="style2 style1"> Cancel</a></td>
</tr>
</form>
</table>
</body>
</html>
我不会做读的和保存的,ID的读法有错吗,请指点下,谢谢*^-^*