PHP statistics static HTML page browse access number code

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags access access number code echo html php programming script

PHP tutorial Statistics static HTML page browse access number code
count.php

$aid = isset ($_get[' aid '])? $_get[' aid ']: ';
$t = isset ($_get[' t '])? $_get[' t ']: ';
if (Intval ($aid))
{
if ($t = = ' Show ')
{
echo "document.write (' 120 ');";
}
Else
{
$conn = MySQL Tutorial _connect (' www.jzread.com ', ' root ', ' root ');
$sql = "Update Test set click_num = click_num+1 where aid = ' $aid '";
Mysql_db_query (' db ', $sql, $conn);
}
}

?>

HTML code

<script language= "javascript tutorial" src= "Count.php?aid=5&t=show" ></script> show browse times
<script language= "javascript" src= "count.php?aid=5" ></script> increase the number of views we just put this code on the HTML page, and then put the current HTML The ID of the page to aid on the line, so that your static page access times you can grasp the OH.

This article original in www.jzread.com reprint to indicate the origin

Related Article

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.