Question

I am trying to make PHP script, which will submit ID onto itself and want to make auto submit, like refresh which will send data to refreshed page :)Is it posible to use ;URL=''"> this meta refresh

Était-ce utile?

La solution

You can use this;

<script> 
    window.onload = function() { 
        setInterval(function(){ 
            document.frm.submit(); 
        },5000); 
    } 
</script> 

HTML:

<form id="myform" method="post" name="myform">
    <?php $id = $_POST['id']; $id=$id+1; ?> 
    <input type="hidden" name="id" value="<?php echo $id; ?>"/>
</form>

This will submit form every 5 secs after page loaded

Here is a working demo: jsfiddle

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top