A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Thread: php high score thingy (feedback etc)

  1. #1
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002

    php high score thingy (feedback etc)

    this is a php highscore thingy i did. i woulda used jerone's but my moronic isp doesn't have mysql (or won't let me use it). i needed the highscore to save a little extra for each high score. my game is a racing type game so i wanted to save the time for each checkpoint so i could show where the player was on the highscore list at each checkpoint.
    things you can do with it;
    1. change the sort key by clicking on the column header (default=score)
    2. change the order from ascending to descending by clicking on the column header again (default=ascending)
    3. the high score will maintain only one entry for each name
    4. you got the extra field to add stuff to (like a date mabey)
    anyway if you interested here's the .zip
    thing's you can't do with it;
    1. generate a html high score
    http://www.nlc.net.au/~oceana/highscore/highscore.zip
    copy the highscore.php and highscore.swf to your server. change highscore.php to executable and your in business.
    if you just wanna perv on it then;
    http://www.nlc.net.au/~oceana/highscore/highscore.swf
    /
    i don't know jack about the security issues so any advice there would be really helpfull.
    thanks
    blink
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  2. #2
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    blinkok,is it intended that lower scores are seen as better ones?
    (ok,i didn´t have a look at the file,just saw your thread and wanted to test it )

  3. #3
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    it's configurable. in my case i want the lower scores to be better coz it's time based (a race). if you click on the column heading of the score it will reverse the order (and the logic by which it adds a new score).
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  4. #4
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    interesting blink

    i put in 10000000000000000 as my score and it came in as 23445546437894 i think you may be adding numbers with quotes instead of as an expression

  5. #5
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    thanks fospher, i think it might be because it's converted to an int. which i think is max 2^32.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  6. #6

  7. #7
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    that woz one of my q's. i think you can do this;
    highscore.php?&score=99999&name=me&action=insert
    so i gotta try and find a way to prevent it
    Blink
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  8. #8
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    heh, being a php retard im always looking for a good highscores method... cant get jers to work on my host either but im getting a new host sorted in the next couple of days so maybe!!...

  9. #9
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    wozza problem?
    lemme edit that. i'll post a debug thingy in a few hrs.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  10. #10
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    no, i didnt try yours, couldnt get jeroens to work... im hostless at the moment, let me see what i can do when i get my new host
    [m]

  11. #11
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    I'll have a play with it Blinky as I've tested nearly all the highscore/php things out there and most of them don't bloody work or aren't secure

    The db password isn't in the swf is it?

    As a quick note, in the SWF you might want to somehow show which field the DB is sorted by and whether its asc or desc

    Also did you try changing the field in the database to a bigINT to over come the 10000000000000000 problem?
    Last edited by Markp.com; 03-02-2003 at 11:23 AM.

  12. #12
    .: Weirded Out :. The_Xell's Avatar
    Join Date
    Nov 2002
    Location
    Under the table and dreaming...
    Posts
    802
    I'm not sure if this should happen? (go into minus numbers)

    Check attachment!
    Attached Images Attached Images

  13. #13
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Hmmm doesn't work on my server...

    Do I have to create a special database or something? (You might want to add a readme.txt file to the zip)

  14. #14

  15. #15
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    The highscore system doesn't use a database, it uses a flat file.
    --------------------------------------------------------
    Make sure you follow these steps;
    1. ftp highscore.php and highscore.swf to your server
    2. change the permissions for highscore.php to executable;
    2.1 unix: login and chmod 0777 highscore.php
    2.2 win: connect to ftp server, right click on the file and make it executable (i think)
    --------------------------------------------------------
    This is a debug kinna thing you can use to mabey see what's goin wrong;
    http://www.nlc.net.au/~oceana/highscore/debug.swf
    change the score and click insert first. then wait a bit and click dump (post a screen dump of the values if you can)
    --------------------------------------------------------
    thanks for all the help
    Blink
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  16. #16
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Originally posted by BlinkOk
    The highscore system doesn't use a database, it uses a flat file.
    --------------------------------------------------------
    Make sure you follow these steps;
    1. ftp highscore.php and highscore.swf to your server
    2. change the permissions for highscore.php to executable;
    2.1 unix: login and chmod 0777 highscore.php
    2.2 win: connect to ftp server, right click on the file and make it executable (i think)
    --------------------------------------------------------
    This is a debug kinna thing you can use to mabey see what's goin wrong;
    http://www.nlc.net.au/~oceana/highscore/debug.swf
    change the score and click insert first. then wait a bit and click dump (post a screen dump of the values if you can)
    --------------------------------------------------------
    thanks for all the help
    Blink
    Trying it now... How easy would it be to convert this flat file to save to a database?

  17. #17
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    ok chmoddedededededededed to 777 still no change. If I try to add an entry via the swf, it does nothing. I tried refreshing. If I try to view the php file directly it tells me:

    Warning: file("scores.tbl") - No such file or directory in /****/******/highscore.php on line 84
    &msg=&done=1
    So do I have to create this tbl file?
    Last edited by Markp.com; 03-02-2003 at 07:24 PM.

  18. #18
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    Originally posted by Markp.com
    ok chmoddedededededededed to 777 still no change. If I try to add an entry via the swf, it does nothing. I tried refreshing. If I try to view the php file directly it tells me:



    So do I have to create this tbl file?

    ditto

  19. #19
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    first you need to insert a score. that should create the file. if it doesn't then login and use the command;
    touch scores.tbl
    thanks for the help, this is great!
    Blink
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  20. #20
    Senior Member mbenney's Avatar
    Join Date
    Mar 2001
    Posts
    2,744
    Originally posted by BlinkOk
    first you need to insert a score. that should create the file. if it doesn't then login and use the command;
    touch scores.tbl
    thanks for the help, this is great!
    Blink
    eh!? log in to the whodilly?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center