Red alert. 2 Third Reich NO3 Third Reich Guestbook making process

Source: Internet
Author: User
Show all the messages
$c $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);//calculation of all records $numpage =ceil ($allnums/$numcolumns);//Guestbook Total $numpage pages
$prev = ($pagenum-1) * $NUMCOLUMNS; $next = $prev + $numcolumns;
if ($next >= $allnums)
{$next = $allnums; $numcolumns = $next-$prev;} Handle the last page of $prev, $next
$query = "Select *from Guestbook ORDER BY time DESC limit $prev, $next";
$result =mysql_query ($query); Here is the guestbook page to
for ($i =1; $i <= $numcolumns; $i + +)
{$row =mysql_fetch_array ($result);
Show all the message pages
----------
-Owner reply:-According to the reply person's id number $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 '];//review content echo $rowback [' Timeback '];//reply time}//ecd for
-----------
Handling Reply messages
$c $db =mysql_select_db ("dbname", $conn); $query = "SELECT * from Phpempire"; $result =mysql_query ($query); $row =mysql_fetch_array ($result);
if ($password = = $row [' Password '])
{$timeback =date ("y-m-d-h:i:s"); $query = "INSERT into gback values (' $noteback ', ' $timeback ', ' $id ')"; $result =mysql_ Query ($query);
$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 is not responding for a long time, please click here for the connection
Processing message information:
$c $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 Guestbook
Function: Can realize the owner of the reply, the owner certification
Features: simple structure, expandable function
Cons: Slow speed
This guestbook can see the running situation in Http://phpempire.net, if you are a bit dizzy for some of the process of this guestbook send me email!
"The copyright of this article is owned by the author and house Orso near net, if need to reprint, please specify the author and source"

The above describes the Red Alert 2 Third Reich NO3 The third Empire of the book making process, including the Red Alert 2 The Third Reich content, I hope to be interested in PHP tutorial friends helpful.

  • 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.