high score tables

  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

ok, I have these flash games that write high scores to a txt file to be read out within the game.

What I want to do is create a table within my pages that will display these scores as well. I know how I can do this in PHP, which is not hard at all

My problem is that in the text it reads out with variables like this

Code: [ Select ]
&name1=vladdrac&score1=410&name2=vladdrac&score2=152&name3=liam&score3=147


Is there a way that I can I can take out the & and name, etc. and have it space and break where I want it when it writes to html? How exactly should I go about doing this? Or if anyone knows of any good sources on this kind of a problem.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • jannin
  • Beginner
  • Beginner
  • User avatar
  • Posts: 40
  • Loc: Cranbrook, BC Canada

Post 3+ Months Ago

I'm not exactly sure if about what you mean, but if you mean that you've tried to print the results using php and they printed like this from a variable:
Quote:
&name1=vladdrac&score1=410&name2=vladdrac&score2=152&name3=liam&score3=147

you can use this:
Code: [ Select ]
$new_variable=str_replace("_1_","_2_",$score_variable);

where
$new_variable = the name you choose for your new variable
_1_ = the symbol/word you want to replace
_2_ = the symbol/word you want to replace it with
$score_variable = the name of the variable that holds the score string.

Still not sure if this is at all what you're looking for...

/jannin
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

I think that that is pretty close to what I am looking for.... so what you are saying is that I can try this

Code: [ Select ]
$new_variable=str_replace("_&name1=_","_ _",$name_variable);


and then when

Code: [ Select ]
echo $new_variable;


I am going to assume that it is going to print out

Code: [ Select ]
vladdrac&score1=410&name2=vladdrac&score2=152&name3=liam&score3=147

instead of the full
Code: [ Select ]
&name1=vladdrac&score1=410&name2=vladdrac&score2=152&name3=liam&score3=147


I guesss what I am looking for is how to just pick out each name (vladdrac) and score (410) and make a variable for each.

I can't change the contents of the .txt file or it will not show up in flash (they are just the variables used in flash).

Thanks for your help!
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Have you thought of sending that string to a kickback page ? that way instead of trying to seporate it you could just use it as a regular QueryString.
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

I think i sort of understand what you mean, I am going to try to get it to write to a separate .txt file. I am guessing what you mean is have the flash write those variables into php variables. That would be so much easier, I agree...thanks for the idea joebert, I am going to start on that right now
  • Vladdrac
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2136
  • Loc: Louisville, Ky

Post 3+ Months Ago

just thought of something on this one, couldn't I change the printed out '& ' using jannins example, and changing that to $_.....

I think this will work to change it into a php variable, but after the = i will get an error without quotation marks and ';'

I don't know....Im not real good with php or any other programming language. Maybe I just better start reading some books or something

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: wpas and 106 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.