The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PHP Counter script tutorial

2 posters

Go down

PHP Counter script tutorial

PHP Counter script tutorial Left11100%PHP Counter script tutorial Right11 100% 
[ 2 ]
PHP Counter script tutorial Left110%PHP Counter script tutorial Right11 0% 
[ 0 ]
 
Total Votes : 2
 
 
Poll closed

PHP Counter script tutorial Empty PHP Counter script tutorial

Post by LUDAKLUDI 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








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


Step
1. Create table "counter" in database "test".
2. Create file counter.php.
</td>
</tr>
</table>





<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%">PHP Counter script tutorial Number1</td>
<td width="95%">Create table "counter"</td>
</tr>
<tr> <td colspan="2" bgcolor="#eeeeee">PHP Counter script tutorial Spacer</td>
</tr>
<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'
) TYPE=MyISAM;
</td>
</tr>
<tr> <td align="center">
<table width="100" bgcolor="#cccccc" border="0" cellpadding="0" cellspacing="1"> <tr> <td>PHP Counter script tutorial Db_counter</td>
</tr>
</table></td>
</tr>

</table></td>
</tr>
</table></td>
</tr>
</table>








PHP Counter script tutorial Number2 Create file counter.php
PHP Counter script tutorial Spacer
<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";
$result=mysql_query($sql);

$rows=mysql_fetch_array($result);
$counter=$rows['counter'];

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

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

// count more value
$addcounter=$counter+1;
$sql2="update $tbl_name set counter='$addcounter'";
$result2=mysql_query($sql2);

mysql_close();
?></td></tr></table>

PHP Counter script tutorial
http://www.jooria.com/details-33.html


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

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

Back to top Go down

PHP Counter script tutorial Empty Re: PHP Counter script tutorial

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

PHP Counter script tutorial Permis10 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: https://help.forumotion.com/t93899-suggestions-for-your-forums-how-to
=> Please take a look on the frequently suggested features for your forums:
https://help.forumotion.com/t79095-frequently-requested-suggestions-for-your-forums

Locked & Garbaged

PHP Counter script tutorial Modera10Jophy
Jophy
Jophy
ForumGuru

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

Back to top Go down

Back to top

- Similar topics

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