The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.

Create a free forum like this one.

PHP Counter script tutorial

View previous topic View next topic Go down

PHP Counter script tutorial

100% 100% 
[ 2 ]
0% 0% 
[ 0 ]
Total Votes : 2

PHP Counter script tutorial

Post by LUDAKLUDI on December 12th 2008, 12:22 pm

plz guys put post counter on forums .... i have 23000 post

some topics have 20 pages ... my friends and members want post counter i realy need that on forum

<table width="100%" border="0" cellpadding="0" cellspacing="5"> <tr> <td>In this tutorial create 1 file
1. counter.php

1. Create table "counter" in database "test".
2. Create file counter.php.

<table width="100%" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="3"> <tr> <td><table width="100%" bgcolor="#f4f9fb" border="0" cellpadding="0" cellspacing="1"> <tr> <td width="5%"></td>
<td width="95%">Create table "counter"</td>
<tr> <td colspan="2" bgcolor="#eeeeee"></td>
<tr> <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr> <td>
CREATE TABLE `counter` (
`counter` int(9) NOT NULL default '0'
<tr> <td align="center">
<table width="100" bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="1"> <tr> <td></td>


Create file counter.php
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tr> <td class="Arial"> ############### Code

$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="members"; // Table name

// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect
to server ");
mysql_select_db("$db_name")or die("cannot select DB")

$sql="SELECT * FROM $tbl_name";


// if have no counter value set counter = 1
$sql1="INSERT INTO $tbl_name(counter) VALUES('$counter')";

echo "You 're visitors No. ";
echo $counter;

// count more value
$sql2="update $tbl_name set counter='$addcounter'";


PHP Counter script tutorial

thx in advance !
yea and i know this request expist ... but i must post this again !


Male Posts : 280
Reputation : 3
Language : English,Serbian
Location : Serbia-Belgrade

Back to top Go down

Re: PHP Counter script tutorial

Post by Jophy on April 3rd 2013, 8:31 am

Suggestion Clean up

-> Old suggestions(Please feel to create a new thread for the garbaged old suggestions)
-> Implemented & Rejected suggestions
-> Suggestions which are currently suggested (Please use the SEARCH function)
-> Unclear Suggestions

=> Please read the guidelines for the suggestion section:
=> Please take a look on the frequently suggested features for your forums:

Locked & Garbaged



Male Posts : 17924
Reputation : 835
Language : English
Location : Somewhere

Back to top Go down

View previous topic View next topic Back to top

Permissions in this forum:
You cannot reply to topics in this forum