morocco-iceberg Posted May 16, 2010 Share Posted May 16, 2010 I'm currently constructing an online exam which requires a timer, and when the timer is finished it needs to submit the form on the current page and move to the next page, without allowing the user to go backwards... wondering if this is possible in PHP and if so where should I start? I've been trying to figure this out for a few hours and have done quite a bit of research and attempted a few things, but the only conclusion I can come to is that I will have to use JavaScript, but I would prefer to do it in PHP if it is possible. Link to comment https://forums.phpfreaks.com/topic/201935-php-submit-form-timer/ Share on other sites More sharing options...
siric Posted May 16, 2010 Share Posted May 16, 2010 Don't know if you use just PHP as a normal redirect will not submit as well. I think that you may have to resort to using JavaScript. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <SCRIPT LANGUAGE="JavaScript"><!-- setTimeout('document.test.submit()',5000); //--></SCRIPT> </head> <body> <form name="test" id="form1" method="post" action="http://www.php.net/search.php"> <p> <input name="pattern" type="text" id="pattern" /> <input name="show" type="hidden" id="show" value="quickref" /> </p> <p><input type="submit" name="next" value="Next" /> </p> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/201935-php-submit-form-timer/#findComment-1059082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.