Forum Moderators: open

Message Too Old, No Replies

Being Emailed Hi-Scores via JavaScript

         

pb268

3:04 pm on Apr 23, 2009 (gmt 0)

10+ Year Member



Hi all,

I've written a javascript game which displays a Score and Code at the end and asks the player to email them to me if they wanted to be included in a Hi-Score table.

I'm sure there are a lot smarter ways of doing this BUT I only know a bit of javascript & HTML :O)

The idea is a form which is diplayed when the player gets a hi-score... they enter their name, press [Send] and the details are emailed to be. The form should also contain the values of the variables Score and Code. Any suggestions how I should go about this?

Many thanks.

P.s.
Site is mainly for young ones, so all names would have to varified manually anyway. Also, from previous experiance, would not expect more that 2 or 3 emails a day to start with, becomming fewer as it gets harder to find a place on the table.

DrDoc

5:23 am on Apr 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have a way to verify that they are not cheating and submitting a score that was not achieved honestly?

pb268

8:21 am on Apr 24, 2009 (gmt 0)

10+ Year Member



Yes, the variable 'Code' will contain a certain letter combination based on the score.

Have seen some code to use Forms in HTML but can't see how to add JavaScript variables to the message.

Hoping to receive emails like this:

Name: John
Score: 12.9
Code: ZIDH

DrDoc

5:29 pm on Apr 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are several posibilities:
1) redirect somewhere for the form
2) use
innerHTML
to add the form to a given container
3) manipulate the DOM to make the form display

pb268

7:34 am on Apr 25, 2009 (gmt 0)

10+ Year Member



Thanks DrDoc, that's given me a few options to thing about.