many refreshes
Moderator: General Moderators
many refreshes
what happens when user refreshes page so fast that there is not enough time (between refreshes) for php script to run to the end?
each time server will launch new instance of the same script(php page)?
each time server will launch new instance of the same script(php page)?
i didn't undestand you... maybe i was not clear in my question....i'll try again
i open at the same time in my browser the same page 5 times. each page has a form. i fill all 5 forms and hit submit for each of them. now, you say that for each submission i make, server will launch the same script 5 times...each script proccess form's data and does something with it...
so here is the problem because i don't want five instances to work on the same form...
i open at the same time in my browser the same page 5 times. each page has a form. i fill all 5 forms and hit submit for each of them. now, you say that for each submission i make, server will launch the same script 5 times...each script proccess form's data and does something with it...
so here is the problem because i don't want five instances to work on the same form...
Multiple form posts can be a pain. If the data is being dumped into a database table, then try an approach like this:
Same thing could be acheived using session variables and checking for their existence with the same YES/NO responses
The problem with this is that you are not giving the user a chance to correct a form which they posted incorrectly! Many sites simply have a message 'PRESS THE SUBMIT BUTTON ONCE ONLY, FORM MAY TAKE A FEW SECONDS TO POST' lol! sometimes that might be the best thing,
cheers,
Mike
Code: Select all
//include an email field on form
- user posts form
//Your script on the server
- Query database for existence of user's email
- Is user's email already in database?
NO{
- Stick user email into database
- Stick form data into database (or email it or whatever)
}
YES - Ignore user form input
- endThe problem with this is that you are not giving the user a chance to correct a form which they posted incorrectly! Many sites simply have a message 'PRESS THE SUBMIT BUTTON ONCE ONLY, FORM MAY TAKE A FEW SECONDS TO POST' lol! sometimes that might be the best thing,
cheers,
Mike