Click to See Complete Forum and Search --> : Contest problems
bonker
01-12-2003, 01:42 PM
Hello everyone! Could somebody help a newbie from Sweden?
I`m putting up a hompage with a small playful contest.
I modifyed the "Stopwatch" script, so instead of the "start/stop" and "reset" button, it`s now "start" "stop" "reset" and "submit" buttons.
The idea is that the contestent would start the stopwatch and stop it as fast as he can. When he is satisfied with the result, he submits it and it appears on the next page along with the user details. I want the result AND name/address/mail sent to me by mail.
Now, I have the "user details" form working, but how do I get the result from the previous "stopwatch" page to the "user detail" form page? The result should of course be locked. Not editable(spelling?) I don`t want people to cheat.
I`ve spend hours trying to solve it but now i`m giving up:(
Please help me!
AdamBrill
01-12-2003, 03:36 PM
You could put it into a hidden form tag. Then, it should get submitted along with everything else. Let me know if you need more help...
bonker
01-12-2003, 04:56 PM
Originally posted by AdamBrill
You could put it into a hidden form tag. Then, it should get submitted along with everything else. Let me know if you need more help...
Thank you AdamBrill for the quick reply, but...
Hmmm. I don´t really follow... I`m a newbie :(
Actually, it`s 3 pages. Sorry, my mistake. 1=game 2=saving result (this page is just for show) 3=user details.
I put these pages up on: http://w1.243.telia.com/~u24314433/Annat/1.htm
On page 3 i would like to have the "Your result" ontop the other forms.
I would be VERY greatful if you could have a look at the sourcecode, and maby edit it so it will work:)
I mean, you guys know what you´re doing:)
AdamBrill
01-12-2003, 11:04 PM
Ok, I didn't like that code, so, I remade it. :) I used PHP to send it(I hope that's ok). If you can't use PHP, I could rewrite it using a mailto, but then it would popup a message asking them if they want to send it. I added another box for the users to put there name so you can tell who it was that set the record.
Now, to set it up. :) First of all, it will only work when it is on the server(because it uses PHP). So, just upload all three files to the same directory. The only thing you have to change in the files is in the .php, you must change this line:
$to="adambrill1986@hotmail.com";
change the address to wherever you want the e-mail to be sent. Then in this line:
//SUCCESS!!!!
header("location:1.htm");
change the 1.htm to the page you want it to go to if it is a success. Then in this line:
//FAILED!!!!
header("location:error.htm");
change the error.htm to the page you want it to go to if there is an error. I think that should be all that you have to change.
One more thing, if you want to change the names of the files, you will have to edit the place that the pages are sent. If you need help with that, or anything else, let me know...
bonker
01-13-2003, 08:54 AM
Damn... I can`t use PHP. You wrote that you could rewrite it. I would be very greatful if you could:) I`m VERY exited to see the result:D
Thanx.
Glenn...
AdamBrill
01-13-2003, 09:39 AM
I'm sorry... I should have asked first. :) Anyway, I'll try to get you the mailto version later today...
AdamBrill
01-13-2003, 10:24 AM
Ok, here is the mailto code. There is one thing that is weird, though. When you send it, it puts a ? at the end of the e-mail. Don't ask me why. :) I'm pretty good at javascript, but HTML isn't my thing... ;) BTW, my record is 110! :D
bonker
01-13-2003, 01:21 PM
It gets better and better. :D
But, I changed my mind a little bit. It`s easier if I put the "user detail" form at the same page, don`t you think? I added some detail-boxes underneath the "game", but i can`t get the details to be copied into the mail. The only thing that stick is the box you added. How do you do that??? I spend 2.5 hours trying to add these extra boxes but I don`t got a clue how to do this :( Is there a "script-program" one can download or someting?
If you can get this to work I will be SO satisfied, and you`ll get rid of me :D
Please bare with me!... I can see the lights at the end of the tunnel now ;)
How the ... did you managed to score 110???:)
AdamBrill
01-13-2003, 02:03 PM
New record: 100 :D And I am serious! I guess I use my mouse a lot. :) Build up those finger muscles!!! I'll try to get it working and then post it again...
AdamBrill
01-13-2003, 06:52 PM
Check out the attached code. It should work fine for you. BTW, why did you put the reset button in between the start and stop button? Then I can't get as good of a record! :) Let me know if you have any more problems...
bonker
01-14-2003, 12:50 AM
Thank you VERY much AdamBrill for all your help:D
It works beautifully.
What would ameteurs like myself do without guys like you?
Now I won`t bother you no more ;) 4 a while anyways :D
Ps. you were getting too high scores ;)
Thanx again!
Glenn from Sweden...
Webskater
01-14-2003, 04:52 AM
Here's a suggestion:
Why don't you put the current top 10 scores on the page so you can see what you are up against.
The best I can do is 200 and thats moving the focus to the Start button and then hitting Enter - Tab - Enter as fast as I can
Webskater
01-14-2003, 04:55 AM
Now I'm down to 130 but when I tried to submit I got a "the page cannot be displayed error". I am very pleased about this because now I can get back to my work instead of playing with your excellent game!
bonker
01-14-2003, 05:48 AM
Webskater
Hahaha. One sholdn`t be doing this when one is suppose to be working :D
Yep, you`re right. There will be a "top ten score". Just don`t know how to get the score from the contestent into the "top ten" by automatic.
AdamBrill???;) (it`s been a while now!:D )
AdamBrill
01-14-2003, 08:06 AM
bonker-Well, I would have, but you would have to use PHP or some server-side scripting language. So, if you can't use that, you'll probably have to manually put the info in there. Sorry...
Webskater-BTW, I fixed it so that you can no longer go "Enter-tab-Enter". :) So, you'll have to start clicking!!! :D I don't know if bonker has the latest version online, so you might still be able to do it on the online version, I'm not sure...
bonker
01-14-2003, 08:54 AM
Haha, your cheatingdays are over Webskater;)
AdamBrill: If the "latest version" is the third attatchment you made, then I got it.
Webskater
01-14-2003, 10:18 AM
I knew I was taking a risk revealing my game plan.
bonker
01-14-2003, 10:21 AM
Webskater
One can always try;)
AdamBrill
01-14-2003, 12:16 PM
bonker-Yes, that's the latest version. What I meant is I wasn't sure if you had the latest version online yet. A little confusing...:)
bonker
01-14-2003, 12:26 PM
AdamBrill
Yep, I got it :)
Question:
If the "mailscript" was placed in the same window as the game (instead of the next window 2.htm) do you think the problem with the "mailpopup" will go away? Hmmm. The contestent can edit the score before he sends the mail.
http://w1.243.telia.com/~u24314433/Annat/3.htm
In this "mailto" the mail just flashes before you and off it go...
Glenn...
AdamBrill
01-14-2003, 01:15 PM
No, that just happens when you use mailto. If you could use PHP, it would work fine, but... Maybe you could try getting a new host? I don't know if that is a possiblity or not, but if you could get one that supports PHP, it could be a lot better.
bonker
01-14-2003, 01:17 PM
But why does it work in 3.htm?
AdamBrill
01-14-2003, 02:55 PM
Actually, I tried that one, and it didn't work at all for me. It just popped up a blank e-mail. So, I don't know why it worked for you... Did you actually get the information in the e-mail? or did it just send it?
bonker
01-14-2003, 04:20 PM
If I put in details and send it, then I`ll recive a mail with the information I wrote. I`ll try it at work tomorrow.
bonker
01-15-2003, 05:48 AM
Hmm, I tried it at work but I got a warningwindow that said: A program it trying to send a message... Do you want to send it?" I clicked Yes but there was no mail sent...
Why does it work at home???
Anyone knows???
AdamBrill
01-15-2003, 07:22 AM
That is a security setting. You probably have the security at your job set to not let you submit through a mailto form. I think you can change that in your internet options. If you go into the security tab, then click the custom levels button, it should be one of the choices in there. It says something about submitting unsecure forms or something like that....
bonker
01-15-2003, 09:44 AM
Is it possible to change the score-font color to white? If the score-result in the mail is white, the contestent can`t see that he is sending it in the mail. He can only see the user details. Unless he uses those html-mail.
Can it be done:confused: