|
Very simple PHP code for Easy Counter
|
|
|
|
|
Saturday, 21 March 2009
|
|
HTML clipboard
This tutorial require 1 PHP file and 1 table of mySQL database.
- easy_counter.php
- Database "tutorial" and table "easy_counter" with 1 fields: visitor(Int,
11). You need to insert a first one record with "0".
easy_counter.php
Source Code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Counter :
<?
mysql_connect("localhost","","");
mysql_select_db("tutorial");
mysql_query("update easy_counter set all_visitor=all_visitor+'1'");
$result=mysql_query("select * from easy_counter");
$row=mysql_fetch_assoc($result);
echo $row['all_visitor'];
.
mysql_close();
?>
</body>
</html>
|