Jump to content

I have a chall- Oh, to ###### with it, HELP ME!


Matt

Recommended Posts

Well, thanks for reading this, it means you're trying to help!Here's what I need, basically.I have a comments form on a page on my site:http://matt.artemis-fowl.com/comments/comments.phpBut I need to make some serious edits to suit my needs. Please note that I'll be downloading it all and reuploading it to a new server with a different database, I'm testing through this one.I need it to there's no "E-mail" Input Field, and no checkboxes underneith it (There's two, currently, "Notify me of..." and "Hide my e-mail."I figure that bit should be fairly easy. Here's the REALLY hard part.I need it so that the user has exactly 3 minute to enter their comment, and after those three minutes, the comment gets posted and the user gets redirected to a page where they CANNOT post another message, and have no way of simply clicking back to post another.Please help, I know it's really tricky, but please.Thanks again!Matt

Link to comment
Share on other sites

well in the html, just delete the word Email and the form box that comes after it. Then search for checkbox and delete those 2 tags.As for the 3mins, you will need to use some JS with a timer script. After 180 secs you could have JS get the content from the form and send the url with the data (in the url) to a new page. The new page could send you the data and do what ever else.

Link to comment
Share on other sites

You wouldn't need to send the data through the URL, there is a javascript form.submit method. Problem is, anyone could just turn off javascript and the limit wouldn't matter. You may be able to get around that by having the submit button start disabled and enable it through javascript, so that if javascript is off they can't submit at all. But then again, it would be easy enough to turn off javascript after the button has already been enabled.The only reliable way you could do this would be to record the time in a database or file when they open the form, and then check the time when they submit to make sure they are under. But then you would either trash their post and say they didn't do it quick enough, or save it if they did. There wouldn't be a way to just submit it after 3 minutes. You could have a javascript timer count down to 3 minutes so at least they know how much time they have. And maybe give them an extra 5 or 10 seconds leeway so if they hit submit right at 3 minutes, considering the few seconds of transfer time to the server, they will still make it in time.You could do the whole thing in Flash, that would let you do it. You could make a Flash form and have a timer keep track there. They wouldn't be able to disable that. But then you have to learn Flash..

Link to comment
Share on other sites

Don't worry about their post not getting submitted quick enough, that's the idea.So, it can be done? And I know someone who can do Flash, I'll speak to him about it, but I'd REALLY prefer it if I could do it through coding... so is there any die-cast ways I can do this?

Link to comment
Share on other sites

There are really only 2 ways that you can be sure users won't be able to get around the time limit. One is to use a server-side language to record when they start and when they finish (do not pass the start value with the form, the start time needs to be saved in a temporary database or file on the server). The other way is to use Flash to have both the form and the timer in the Flash movie. If they have Flash disabled, they don't get the form either, so they need to enable Flash which will give them both the form as well as the timer.

Link to comment
Share on other sites

I'm now having serious problems. The whole page is written in PHP, and I really don't know how to read it.I cannot seem to delete the parts I want to delete, the e-mail part of the form, and the two checkboxes, and I also need to move the comment form so it's ABOVE the comments that have been posted.Please help, this is, actually, for once, extremely important.

Link to comment
Share on other sites

You could use:

<html><head><script type="text/javascript">function comment_timeout(){   setTimeout("document.getElementById('comment_form').submit()", 100*60*3);}</script></head><body onload="comment_timeout()"><form id="comment_form" action="submitcomment.php"><!-- some inputs --></form><p>Your comment will be automaticly submitted in 3 minutes.</p>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...