Tiny winy PHP question :P - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Tiny winy PHP question :P (/showthread.php?tid=57185) Tiny winy PHP question :P by ayjay on 03-19-2006 at 03:34 PM
Just a little test script to increase the number by 1 every time the page is refreshed and it works fine, but if you hold down F5 to refresh for quite a while, the number decreases and I can't work out why :/ code: RE: Tiny winy PHP question :P by Josh Loughlin on 03-19-2006 at 03:52 PM i dont understand bu the font goes bigger after refreshing once RE: Tiny winy PHP question :P by absorbation on 03-19-2006 at 03:53 PM
Wait I am confused with all these mix of varibles, $x and $y, but it should work fine. Maybe it is your browser problem. I try not to use txt files but mysql: RE: Tiny winy PHP question :P by RaceProUK on 03-19-2006 at 04:02 PM
Wouldn't code:be simpler? Or, if there's a PHP equivalent of C's scanf, use that to read the number from the file, and a printf equivalent to write it. RE: Tiny winy PHP question :P by J-Thread on 03-19-2006 at 04:07 PM
code: How about that? RE: Tiny winy PHP question :P by ayjay on 03-19-2006 at 04:41 PM
There are probably loads of easier ways than I used but I wrote this after 4 hours of learning so I still don't know much RE: Tiny winy PHP question :P by WDZ on 03-20-2006 at 05:18 AM
For a counter script, it's also a good idea to use file locking to prevent multiple instances of the script from messing with the file at the same time. RE: Tiny winy PHP question :P by ayjay on 03-20-2006 at 08:23 PM
quote:Ah great. That'll probably be why it goes dodgy if you hold down F5 Thanks. RE: Tiny winy PHP question :P by hmaster on 03-20-2006 at 09:00 PM
Heres a commented version of a 'hit logger' code: logger.txt should have 0 to begin with |