The guest book supporting OICQ Avatar (ii) _php Foundation
Last Update:2017-01-19
Source: Internet
Author: User
addnote.php
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE> Add Message </TITLE>
<style type= "Text/css" >
<!--
. white12 {font-size:12pt; color: #FFFFFF; Text-decoration:none}
-->
</style>
</HEAD>
<body bgcolor= "#FFFFFF" >
<table width= "98%" border= "0" cellspacing= "0" cellpadding= "0" height= ">"
<tr>
<TD height= "width=" 34% ><a href= "http://www.medguider.com" ><img "src=" image/logo.gif "243" height= "alt=" "Medical Navigation Network" border= "0" ></a></td>
<TD height= "width=" "66%" >
<div align= "center" ><img src= "image/note.gif" width= "410" height= "" ><img src= "Image/y1.gif" "width=" "Height=" ></div>
</td>
</tr>
</table>
<?php
Include ("config.php");
if ($submit) {
$time =date ("Y-year m-month D-day h:i:s A");
$IP = $REMOTE _addr;//message person IP address
$name =trim ($name);
$email =trim ($email);
$title =strip_tags ($top);
$nnote =nl2br (Strip_tags ($content));//Remove HTML tags First, and then convert line breaks to <br>.
if (! $name | |! $email | |! $title | |! $nnote) {//Check to complete
echo "Sorry, you must fill in all the content!<br>". <a href= ' javascript:history.back () ' > Return </a> ';
Exit }elseif (!ereg) (' ^[-!#$%& ' *+./0-9=? A-z^_ ' a-z{|} ~]+'.' @'.' [-!#$%& ' *+\/0-9=? A-z^_ ' a-z{|} ~]+.'.' [-!#$%& ' *+\./0-9=? A-z^_ ' a-z{|} ~]+$ ', $email)//email legality verification
){
echo "Email is not legal!<br>". <a href= ' javascript:history.back () ' > Return </a> ';
Exit
}
Writing to the database
$sql = "INSERT into notebook (name,email,time,face,ip,title,nnote) VALUES (' $name ', ' $email ', ' $time ', ' $face ', ' $ip ', ' $ Title ', ' $nnote ');
$result = mysql_query ($sql, $db);
Mysql_close ($DB);
echo "Message success!" ";
}
?>
<table width= "99%" border= "1" cellspacing= "0" cellpadding= "0" align= "center" bordercolor= "#3366FF" >
<tr bgcolor= "#3366FF" >
<TD width= "81%" class= "White12" height= "><a href=". /index.php "class=" White12 "> Home </a>
> <a href= "index.php" class= "White12" > Guest book </a>
> Add Message </td>
<TD width= "19%" class= "White12" height= "" ><a href= ' index.php ' class= "white12" > View message </a>
</td>
</tr>
<tr>
<TD colspan= "2" >
<form name= "Form1" method= "Post" action= "addnote.php" >
<table width= "99%" border= "0" cellspacing= "0" cellpadding= "0" >
<tr>
<TD width= "54%" > </td>
<TD rowspan= "2" width= "46%" > Choose a portrait of your own liking:<br>
<img src= "Image/face/icon1.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "1" checked>
<img src= "Image/face/icon2.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "2" >
<img src= "Image/face/icon3.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "3" >
<img src= "Image/face/icon4.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "4" >
<img src= "Image/face/icon5.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "5" >
<img src= "Image/face/icon6.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "6" >
<img src= "Image/face/icon7.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "7" >
<img src= "Image/face/icon8.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "8" >
<img src= "Image/face/icon9.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "9" >
<img src= "Image/face/icon10.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "ten" >
<img src= "Image/face/icon11.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "one" >
<img src= "Image/face/icon12.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon13.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon14.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon15.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon16.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon17.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon18.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon19.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon20.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon21.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon22.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon23.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon24.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon25.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon26.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon27.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon28.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon29.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon30.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon31.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon32.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon33.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon34.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon35.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon36.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon37.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "Panax Notoginseng" >
<img src= "Image/face/icon38.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon39.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon40.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon41.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "a" >
<img src= "Image/face/icon42.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon43.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon44.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon45.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon46.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon47.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon48.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon49.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon50.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "M" >
<img src= "Image/face/icon51.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "Wuyi" >
<img src= "Image/face/icon52.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon53.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon54.gif" width= "height=" >
<input type= "Radio" name= "Face" value= "Si" >
<img src= "Image/face/icon55.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon56.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon57.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon58.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon59.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon60.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon61.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon62.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon63.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
<img src= "Image/face/icon64.gif" width= "height=" >
<input type= "Radio" name= "Face" value= ">"
</td>
</tr>
<tr>
<TD width= "54%" > Name
<input type= "text" name= "name" >
<br>
Email
<input type= "text" name= "email" >
<br>
Title
<input type= "text" name= "Top" size= "M" >
<br>
Content <br>
<textarea name= "Content" cols= "rows=" ></textarea>
</td>
</tr>
<tr>
<TD colspan= "2" >
<div align= "center" >
<input type= "Submit" name= "Submit" value= "OK" >
<input type= "reset" name= "Cancel" value= "rewrite" >
</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<p><a href= "MAIN.PHP?USER=<? echo $user?> "class=" White12 "><br>
</a></p>
</BODY>
</HTML>
delnote.php
<?php
Include ("config.php");
if ($superadmin) {//If the administrator has logged in, password verification
if (!) ( $user = = $username) | |! ($PSW = = $password)) {
echo "Password Error";
Exit
}
}else{//Admin Login
echo "<form name= ' Form1 ' method= ' post ' action= ' $PHP _self ' >";
echo "<div align= ' center ' > Please enter admin password <br>";
echo "admin";
echo "<input type= ' text ' name= ' user ' ><br>";
echo "Password";
echo "<input type= ' password ' name= ' PSW ' ><br>";
echo "<input type= ' submit ' name= ' superadmin ' value= ' into ' ><br> ';
echo "<input type= ' reset ' name= ' Cancel ' value= ' rewrite ' ></div>";
echo "</form>";
Exit
}
if ($del ==1) {//Determine if you want to delete
mysql_query ("Delete from notebook where time= ' $time '", $db); Take the message time as the deletion sign
echo "Delete success!" ";
}
?>
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE> Delete Message </TITLE>
<style type= "Text/css" >
<!--
. blue9 {font-size:9pt; color: #0099FF; Text-decoration:none}
. black9 {font-size:9pt; Text-decoration:none}
. purple10 {font-size:10pt; color: #9900FF; Text-decoration:none}
. white12 {font-size:12pt; color: #FFFFFF; Text-decoration:none}
a:visited {color: #FFFFFF}
a:link {color: #FFFFFF}
-->
</style>
</HEAD>
<body bgcolor= "#FFFFFF" >
<?php
$result = mysql_query ("Select * from Notebook", $db);
$row =mysql_num_rows ($result);//See how many rows the result has
$max = $row; Total posts
Set each page to display 10, $p total number of pages, $page the first few pages, $low starting from the first few lines, $x read a few lines
if (! $page) {$page = 1;}
$p =ceil ($max/10);
$low =10* ($page-1);
if ($page = = $p && ($max%10) <>0) {$x = ($max%10);} else {$x = 10;} If it is the last page and is not an integer multiple of 10, read the remainder of the $max divided by 10, or take 10
if ($max ==0) {$x = 0;} If there are no posts, $x take 0
$result = mysql_query ("Select * from Notebook" DESC limit $low, $x ", $db);
?>
<table width= "98%" border= "0" cellspacing= "0" cellpadding= "0" height= ">"
<tr>
<TD height= "width=" 34% ><a href= "http://www.medguider.com" ><img "src=" image/logo.gif "243" height= "alt=" "Medical Navigation Network" border= "0" ></a></td>
<TD height= "width=" "66%" >
<div align= "center" ><img src= "image/note.gif" width= "410" height= "" ><img src= "Image/y1.gif" "width=" "Height=" ></div>
</td>
</tr>
</table>
<table width= "1" cellspacing= "0" cellpadding= "0" height= "253" bordercolordark= "#FFFFFF" bordercolorlight= "#003399" align= "Center" >
<tr>
<TD height= ">"
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "height=" "bgcolor=" #3366FF ">
<tr>
<TD width= "28%" class= "White12" > Home
> <a href= "index.php" class= "White12" > Guest book </a></td>
<TD width= "56%" class= "White12" >
<?php
echo "Total number of posts:", $max, "section";
for ($n =1; $n <= $p; $n + +) {
echo "<a href=index.php?page= $n > $n </a>";
}
echo "Page";
?>
</td>
<TD width= "16%" ><a href= "index.php" class= "white12" > View message </a></td>
</tr>
</table>
<?php
For ($i =0 $i <= ($x-1); $i + +) {
$email =mysql_result ($result, $i, ' email ');
$face =mysql_result ($result, $i, ' face ');
$face = ' Image/face/icon '. $face;
$name =mysql_result ($result, $i, ' name ');
$time =mysql_result ($result, $i, ' time ');
$ip =mysql_result ($result, $i, ' IP ');
$title =mysql_result ($result, $i, ' title ');
$nnote =mysql_result ($result, $i, ' nnote ');
Echo ' <table width= ' 100% ' border= ' 0 ' cellspacing= ' 0 ' cellpadding= ' 0 ' height=107 ' bordercolor= ' #FFFFFF ' > <tr Bgcolor= ' #eeeeee ' > ';
echo "<td width= ' 10% ' height= ' bgcolor= ' #eeeeee ' class= ' blue9 ' > <img ' $face. gif ' src= ' width= ' 32 ' ></td> ";
echo "<td width= ' 16% ' height= ' bgcolor= ' #eeeeee ' class= ' blue9 ' > Message person: $name </td>";
echo "<td width= ' 41% ' height= ' bgcolor= ' #eeeeee ' class= ' Blue9 ' > published in: $time </td>";
echo "<td width= ' 12% ' height= ' ' bgcolor= ' #eeeeee ' class= ' blue9 ' ><a href= '," mailto ": $email ' ><img src= ' Image/email.gif ' width= ' height= ' border=0></a></td> ';
echo "<td width= ' 21% ' height= ' class= ' blue9 ' ><img src= ' image/ip.gif ' ' width= '," ' height= ' "> $ip &L T;a href= ' $PHP _self?del=1&time= $time &superadmin= $superadmin &user= $user &psw= $psw ' ><img src= ' Image/del.gif ' width= ' height= ' border=0></a></td> </tr> <tr> ';
echo "<td colspan= ' 5 ' class= ' purple10 ' height= '" > title: $title </td> </tr> ";
echo "<tr bgcolor= ' #ffffff ' ><td colspan= ' 5 ' class= ' black9 ' height= '" > Message content: $nnote </td></tr> ;</table> ";
}
Mysql_close ($DB);
?>
</td>
</tr>
</table>
</BODY>
</HTML>