Jump to content

Update form on countdown


mrt003003

Recommended Posts

Hi there i was wondering if its possible to have a count down timer (for say 5 mins) that when it reaches 0 a form is updated..

 

<?php
// set countdown timer for 5 mins 
$countdown = '300' 

if ($countdown == '0'){

update the form somehow? }?>


<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<input name="hiddenField" type="hidden" value="<?php echo $row_query['somedata']; ?>" />
<input type="submit" name="Submit" value="Submit" />
</form>

 

I'm a bit of a noob so any help would be ace.

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/237927-update-form-on-countdown/
Share on other sites

Hmm is there no way to do it in php alone? Something like:

 

$countdown = '300' 

if ($countdown == '0'){

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE table SET something = '1'");

  mysql_select_db($database_swb, $swb);
  $Result1 = mysql_query($updateSQL, $swb) or die(mysql_error());  }?>

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.