把app的文章分享出去了,但是要看多少人看了这篇文章(浏览数)
在分享页面写:
<?php
$link = mysql_connect("120.25.226.231","web","web") or die ("打开数据库失败");
mysql_select_db("taiji",$link); //连接数据库
mysql_query("update tj_document set view=view+1 where id=".$_GET['id']);
?>
mysql_connect(地址,用户名,密码)
只是统计某网页浏览数
<script type="text/javascript">
if (localStorage.pagecount)
{
localStorage.pagecount=Number(localStorage.pagecount) +1;
}else{
localStorage.pagecount=1;
}
document.write("访问数: " + localStorage.pagecount + " time(s).");
</script>