View previous topic :: View next topic |
Author |
Message |
gctmpr -
Joined: 28 Apr 2007 Posts: 18
|
Posted: Sun May 06, 2007 9:10 am Post subject: php live hit counter |
|
|
pls help me....
i am no way how to write wap php live hit counter code...
how to add inside here?
Code: |
<?
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
include("wapbuddy_settings.php"); ?>
<wml>
<card id="card1" title="<? echo $conf["site_name"] ?>">
<p mode="nowrap">
<b><? echo $conf["site_name"] ?></b><br/>
<? echo $conf["welcome_message"] ?><br/>
</p>
<p mode="nowrap">
<b>Results</b><br/>
<? for ($i=0;$i<sizeof($conf["dirs"]);$i++) { ?>
<a href="<?echo $conf["dirs"][$i]."/index.php";?>"><?echo $conf["dirs"][$i];?></a><br/>
<? } ?>
<a href="http://arunothai.myvnc.com/registered/MAGNUM4D/index.php">MAGNUM4D</a><br/>
<a href="http://arunothai.myvnc.com/registered/SPORTSTOTO/index.php">SPORTSTOTO</a><br/>
<a href="http://arunothai.myvnc.com/registered/KUDA/index.php">KUDA</a><br/>
<br/><a href="http://jonroig.com/phoneinfo.php">CHECK PHONE INFO</a><br/>
</p>
</card>
</wml>
|
tq _________________ wap site-
arunothai.myvnc.com/registered
username-abyss
password- free
web site
[url]arunothai.myvnc.com[/url] |
|
Back to top |
|
 |
rrinc -
Joined: 24 Feb 2006 Posts: 725 Location: Arkansas, USA
|
Posted: Tue May 08, 2007 12:59 am Post subject: |
|
|
There's a few ways you can make a hit counter. One way would be to just save the number of hits to a file and each page view to add +1 to the number in that file. And to display hits just display the number from the file. Or you could use a database.
By the way, I don't recommend php short tags, its a bad idea/habit.
Edit: I just wrote some quick code for a text file hit counter:
Code: | <?php
$file = 'hits.txt';
$hits = file_get_contents($file);
echo "$hits hits<br />";
file_put_contents($file, $hits + 1);
?> | Note: It'll throw you an error the first time if you don't create hits.txt. _________________ -Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados. |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Tue May 08, 2007 7:42 am Post subject: |
|
|
PHP short tags will only work on a php setup that has them enabled in the php.ini so I agree it is a very bad idea/habit. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
|