PHP Counter script tutorial
2 posters
Page 1 of 1
PHP Counter script tutorial
PHP Counter script tutorial
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
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 !
some topics have 20 pages ... my friends and members want post counter i realy need that on forum
Overview |
<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%"></td> <td width="95%">Create table "counter"</td> </tr> <tr> <td colspan="2" bgcolor="#eeeeee"></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></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table> |
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"; $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- Forumember
- Posts : 280
Reputation : 3
Language : English,Serbian
Location : Serbia-Belgrade
Re: PHP Counter script tutorial
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 Jophy |
Jophy- ForumGuru
- Posts : 17924
Reputation : 836
Language : English
Location : Somewhere
Similar topics
» counter script without links or advertisments
» script and tutorial ideas
» Custom form Tutorial - Script not working
» Requesting Loading Screen Video tutorial or Tutorial
» embed Script code in forum? (<script </script>)
» script and tutorial ideas
» Custom form Tutorial - Script not working
» Requesting Loading Screen Video tutorial or Tutorial
» embed Script code in forum? (<script </script>)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum