Results 1 to 2 of 2
Jun 25, 2012, 16:21 #1
- Join Date
- Jul 2006
- Fionnphort, Isle of Mull, Scotland
- 1 Post(s)
- 0 Thread(s)
How should I automatically re-submit a form ?
I have created a small PHP App that extracts stuff from a MySQL database. Five records are selected at random for extraction and showing on screen. At the bottom of the display is a form (id = 'commentsform') with 'submit' button, which will re-run the script and display a new random selection of results. Works perfectly when I click the submit button manually.
I've written two alternative ways of doing it, which aren't relevant here. I want to see which way runs fastest. I've set up a timer on the script, which works fine, but the result of a single run is so fast I'm trying to run the script 100 times to get a better figure. So at the bottom of my script I have:
This approach to automatically submitting a form is widely advocated on the internet, so I can't see why it doesn't work for me. Can anyone help here, please ?
I'm aware that if it did work there is presently no way of stopping the script, but I can probably take care of that once it works. (The PHP counts to 100, but not not the JS. The easy way might be not to display the form after 100 cycles.)Tim Dawson
Isle of Mull, Scotland