Xing Lin Alumni (ix)

Source: Internet
Author: User
Tags exit config include integer
Class member guest Book Management: class/notebook/delnote.php
<?php
Session_Start ();
if (!session_is_registered ("Superlogin"))//Check for registration
{
echo "<a href=". /.. /superadmin.php ' > Please reboot admin login <BR>;
Exit
}
Include (".. /config.php ");
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>
&LT;TD height= "width=" 34% ></td>
&LT;TD height= "width=" "66%" >
<div align= "center" ></div>"
</td>
</tr>
</table>
<table width= "1" cellspacing= "0" cellpadding= "0" height= "253" bordercolordark= "#FFFFFF" bordercolorlight= "#003399" align= "Center" >
<tr>
&LT;TD height= ">"
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "height=" "bgcolor=" #3366FF ">
<tr>
&LT;TD width= "28%" class= "White12 ><a". /guest.php "class=" White12 "> Home </a>
> <a href= "index.php" class= "White12" > Guest book </a></td>
&LT;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>
&LT;TD width= "16%" ><a href= "index.php" class= "white12" > View message </a></td>
</tr>
</table>
<?php
For ($i =0 $i <= ($x-1); $i + +) {
$user =mysql_result ($result, $i, ' user ');
$time =mysql_result ($result, $i, ' time ');
$ip =mysql_result ($result, $i, ' IP ');
$title =mysql_result ($result, $i, ' title ');
$nnote =mysql_result ($result, $i, ' nnote ');
$yresult = mysql_query ("SELECT * from user where user= ' $user '", $db);/Read Member Database
$name =mysql_result ($yresult, 0, ' name ');
$signature =mysql_result ($yresult, 0, ' signature ');/Read personal signature
$email =mysql_result ($yresult, 0, ' email ');
$face =mysql_result ($yresult, 0, ' face ');
$face = '. /image/face/icon '. $face;
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 ' > </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 ' ></a></td> ';
echo "<td width= ' 21% ' height= ' class= ' blue9 ' > $ip <a href= ' $PHP _self?del=1&time= $time ' ></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&gt ;</table> ";
}
Mysql_close ($DB);
?>
</td>
</tr>
</table>
</BODY>
</HTML>
Guest Guestbook Management: class/notebookg/delnote.php
<?php
Session_Start ();
if (!session_is_registered ("Superlogin"))//Check for registration
{
echo "<a href=". /.. /superadmin.php ' > Please reboot admin login <BR>;
Exit
}
Include (".. /config.php ");
if ($del ==1) {//Determine if you want to delete
mysql_query ("Delete from notebookg 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 notebookg", $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 notebookg" DESC limit $low, $x ", $db);
?>
<table width= "98%" border= "0" cellspacing= "0" cellpadding= "0" height= ">"
<tr>
&LT;TD height= "width=" 34% ></td>
&LT;TD height= "width=" "66%" >
<div align= "center" ></div>"
</td>
</tr>
</table>
<table width= "1" cellspacing= "0" cellpadding= "0" height= "253" bordercolordark= "#FFFFFF" bordercolorlight= "#003399" align= "Center" >
<tr>
&LT;TD height= ">"
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "height=" "bgcolor=" #3366FF ">
<tr>
&LT;TD width= "28%" class= "White12 ><a". /guest.php "class=" White12 "> Home </a>
> <a href= "index.php" class= "White12" > Guest book </a></td>
&LT;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>
&LT;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 ' > </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 ' ></a></td> ';
echo "<td width= ' 21% ' height= ' class= ' blue9 ' > $ip <a href= ' $PHP _self?del=1&time= $time ' ></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&gt ;</table> ";
}
Mysql_close ($DB);
?>
</td>
</tr>
</table>
</BODY>
</HTML>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.