Welcome Guest. Please Login or Register  


You are here: Index > General Stuff > Scripting Help > PHP > Topic : Simple Counter


News:

Group Message
Hello Guest,

Welcome to the AEF Board. AEF is getting better and better and is also becoming more popular.
Take a few seconds to Register, its free, and it inspires us to work harder and improve on whatever we can improve on.
Give us some feedback, and tell your buddies about AEF!

Thanks,
The AEF Team



Threaded Mode | Print  

 Simple Counter, Enjoy! (2 Replies, Read 2757 times)
Keith
Group: Member
Post Group: Newbie
Posts: 20
Status:

AEF Staff
Here is a Nice "Counter" Code I've made.

Create a New PHP Page, and Insert the Fallowing Code
PHP Code

<?php
//Coded by Keith - http://www.anelectron.com
//(C) Copyright 2007 Keith Codes™. All Rights Reserved.
$file "counter.txt";
$fp= @fopen($file,"r+"); //this opens the file
$myCounter = (int)fgets($fp,10000); //
++$myCounter//
rewind($fp);
fwrite($fp,$myCounter); //this will write the value
fclose($fp);
echo 
$myCounter//this shows the value
?>



And Insert the Fallowing Code into a Space for the Counter to Show up. Make sure you put it in a valid  area for PHP Code.
PHP Code

<?php
include("counter.php);
?>




If you have any Problems while using this Code, Please PM me or Reply to this Post for Support.

Thanks,
Keith


Edited by Keith : September 10, 2007, 1:34 am

-----------------------
Board Image
IP: --   

Simple Counter
jlhaslip
Group: Administrator
Post Group: Super Member
Posts: 1999
Status:

Local / private text here
Have you tried using this code in the Footer of a Theme to see if it works?


-----------------------
Board Image
IP: --   

Simple Counter
pulkit
Group: Administrator
Post Group: Super Member
Posts: 2467
Status:
Well i had a simple one like that earlier.
It has to work.
Good one keith

-----------------------
Board Image

AEF now featuring in Softaculous - Auto Installer : http://www.softaculous.com
Rate for AEF - http://www.softaculous.com/softwares/forums/AEF
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.

Rollup Banner Stands  cheap car insurance   


AEF web hosting


All times are GMT. The time now is July 29, 2010, 11:48 am.

  Powered By AEF 1.0.9 © 2007-2009 Electron Inc.Queries: 11  |  Page Created In:0.299