Topic awaiting preservation: another question (sorry) . . . |
|
---|---|
Author | Thread |
Maniac (V) Inmate From: there...no..there..... |
posted 05-14-2003 19:58
Still working with the same PHP script, this time I have something different about it though. |
Maniac (V) Inmate From: under the bed |
posted 05-14-2003 23:45
Basically when you hit refresh it is resending the variables, so it enters the info again. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-15-2003 00:00
There's a couple of techniques for this. One is to use a cookie to prevent reposting within a small amount of time. |
Maniac (V) Inmate From: there...no..there..... |
posted 05-15-2003 03:08
ah, the ol' hidden field trick That sounds good. But can I still save the file with the date stamp? I guess that is what you are saying to do with the hidden field. Maybe not, it's late and I am running on V E R Y little sleep. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 05-15-2003 18:03
Oh absolutely, the trick here is just creating the timestamp earlier. What you do is every time someone goes to the "form" page you create the timestamp there, then pass the timestamp to the page which processes the form (I think it's "posts.php"). This way you should have a single unique identifier for each visit to the form that you can use to make sure there is only one submission per form use. |
Maniac (V) Inmate From: there...no..there..... |
posted 05-15-2003 19:30
Yes, it makes sense. I thought I was reading (and understanding) what you were saying. So I just pass the variable from the form to the posts.php page. Then in the posts.php page, before I actually create the file, I check to make sure that it is NOT there. If it is not then I create it, if it is there, don't create it. |