noirsith Posted July 28, 2008 Share Posted July 28, 2008 I'm trying to create a typing test. The page you have the form in which you type the text into gets automatically redirected to a new page after a set amount of time. While I was able to look at html code for the redirect, the form doesn't really have a submit button or anything so I don't know how to go about posting it so that the content in the form gets to the mysql database in the back end. Usually I do this using a php file that grabs and inserts the data, but I don't know how I would go about calling it in auto-redirected page. Or is there a better way to implement this test? Thank you much! Link to comment https://forums.phpfreaks.com/topic/116991-timed-php-form/ Share on other sites More sharing options...
samshel Posted July 28, 2008 Share Posted July 28, 2008 consider AJAX. there you dont need to submit or redirect to new page, send the data to server after set time using AJAX and hide text box and show message that test completed. Link to comment https://forums.phpfreaks.com/topic/116991-timed-php-form/#findComment-601654 Share on other sites More sharing options...
noirsith Posted July 28, 2008 Author Share Posted July 28, 2008 Thanks for your quick response but I'm a newbie to php, I think AJAX might be over my head. Also my current host doesn't support it. Is there a way to do it in php? Link to comment https://forums.phpfreaks.com/topic/116991-timed-php-form/#findComment-601659 Share on other sites More sharing options...
samshel Posted July 28, 2008 Share Posted July 28, 2008 i think what you need can be done by Javascript and not PHP, you can use setTimeout() function to call a function in javascript after said time..in that JS function you can submit the form.. Link to comment https://forums.phpfreaks.com/topic/116991-timed-php-form/#findComment-601664 Share on other sites More sharing options...
noirsith Posted July 28, 2008 Author Share Posted July 28, 2008 That sounds like a good idea, thank you so much for your help!!! Link to comment https://forums.phpfreaks.com/topic/116991-timed-php-form/#findComment-601730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.