NO3 Third Reich Guest book making process

Source: Internet
Author: User
Tags date insert prev query
Process//Show all messages

$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

$prev = ($pagenum-1) * $NUMCOLUMNS; $next = $prev + $numcolumns;

if ($next >= $allnums)

{$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);

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 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!


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.