PHP+DBM's Alumni Program (3) _php Foundation
Last Update:2017-01-19
Source: Internet
Author: User
6, log out the document LOGOUT.PHP3
?
Setcookie ("Login", False,time () +31536000);
Header ("location:login.php3");
?>
7, modify the information file Modify.php3
?
Require ("common.php3");
$id = $login;
if ($submit) {
if ($name = = "") Error ("Please fill in your name!") ");
ElseIf ($mail = = "") Error ("Please fill in your email address!") ");
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> Alumni User Modification Information </TITLE>
<meta content= "text/html; charset=gb2312 "http-equiv=content-type>
<link rel= "stylesheet" href= "Style.css" >
<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 > Modification Information-Alumni <?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> Email: </TD>
<TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=30 name=mail size=23 value=<?echo$info[2];? >>
* Must fill in </TD>
</TR>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> your 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> your homepage: </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> your 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> your name: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=10 name=name size=23 value=<?echo$info[0];? >>
* Must fill in </td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> your phone: </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> Date of birth: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<input class=stedit maxlength=11 Name=birth size=23 value=<?echo$info[8];? >>
* Similar 2000-10-10 </td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> Contact Address: </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> your career: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<select name= "Job" >
<option value= "Student" > Student </option>
<option value= "Teacher" > Teacher </option>
<option value= "Other" > Other </option>
</select>
</td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> your gender: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<select name= "Sex" >
<option value= "Handsome" > Handsome boys </option>
<option value= "Pretty Girl" > Pretty girl </option>
<option value= "Other" > Other </option>
</select>
</td>
</tr>
<tr>
<TD align=middle bgcolor= #ffffff height=25 width=121> profile: </td>
<TD align=left bgcolor= #ffffff height=25 width=486>
<textarea class= "Stedit" name= "Intro" cols= "" 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= "Confirm modification" class= "STBTM" >
<input type= "reset" name= "reset" value= "Reset Info" class= "STBTM" >
</div></form>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV></TR></TBODY></TABLE><BR><TR><TD></TD></TR>
</BODY>
</HTML>
?
}
?>