$conn =mysql_connect ("hostname", "username", "password"); $db =mysql_select_db ("dbname", $conn); $numcolumns =8;//The number of records displayed per page
$query = "Select *from Guestbook"; $result =mysql_query ($query); $allnums =mysql_num_rows ($result);//Count All records $numpage =ceil ($allnums/$numcolumns); $numpage page in total
{$next = $allnums; $numcolumns = $next-$prev;} Process the last page of the $prev, $next
$query = "Select *from Guestbook ORDER BY time DESC limit $prev, $next";
$result =mysql_query ($query); Here is the Guest book page to
for ($i =1; $i <= $numcolumns; $i + +)
{$row =mysql_fetch_array ($result);
Show all the message pages
----------
-Owner reply:-According to the ID number of the reply $id = $row [' id ']; $queryback = "Select *from gback where id= $id"; $resultback =mysql_query ($queryback); $rowback =mysql_fetch_array ($resultback); Owner reply page echo $rowback [' Noteback '];//retrospective content echo $rowback [' Timeback '];//reply time}//ecd for
-----------
Process reply Information
$conn =mysql_connect ("hostname", "username", "password"); $db =mysql_select_db ("dbname", $conn); $query = "SELECT * from Phpempire"; $result =mysql_query ($query); $row =mysql_fetch_array ($result);
$message = "Please wait ...." Look at all the messages "; else {$message = "Sorry, only the owner can reply!" "; }
Echo $message; The Empire is wonderful because of you.
If the browser does not respond for a long time, click here to connect
Process Message information:
$conn =mysql_connect ("hostname", "username", "password"); $db =mysql_select_db ("dbname", $conn); $time =date ("y-m-d-h:i:s"); $ip = $REMOTE _addr; $query = "Select *from Guestbook"; $result =mysql_query ($query); $id =mysql_num_rows ($result); $id + +; $query = "INSERT into guestbook values (' $username ', ' $city ', ' $email ', ' $homepage ', ' $note ', ' $ip ', ' $time ', $id)"; $result =mysql_query ($query);
Note: No3 Empire guest Book
Function Introduction: can achieve the owner reply, the owner certification
Features: simple structure, expandable function
Disadvantage: Slow speed
This guest book can see the running situation in the Http://phpempire.net, if you are somewhat dizzy to this guest book's certain process to send me the email!
"This article copyright belongs to the author and the Osso net jointly owns, if needs to reprint, please indicate the author and the origin"
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.