|
Posted by Manish on 07/17/06 07:40
As you specified, GET method can be used instead of POST and there will
not be any dialog box during reload (as required).
There are ways and it depends on how you want to implement the
requirement.
<script>
<!--
/* Auto Refresh Page with Time script By JavaScript Kit
(javascriptkit.com) */
//enter refresh time in "minutes:seconds" Minutes should range from 0
to inifinity. Seconds should range from 0 to 59
var limit="0:<?php echo $refsec ?>"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images) {
return
}
if (parselimit==1) {
window.location.reload()
} else {
//get the minutes, seconds remaining till next refersh
parselimit-=1
curmin = Math.floor(parselimit/60)
cursec = parselimit%60
//update the status bar displaying how much time left until next page
refresh
if (curmin!=0) { curtime=curmin+" minutes and "+cursec+" seconds left
until page refresh!" }
else { curtime=cursec+" seconds left until page refresh!" }
window.status=curtime
//set the time limit after which to call beginrefresh function
//it is set as 1000 ms, so that to refresh the status bar every one
sec.
setTimeout("beginrefresh()",1000)
}
}
//call the function beginrefresh
window.onload=beginrefresh
//-->
</script>
you can remove the "else" case in beginrefresh(). It will just show in
status bar how much time is left for next refreash.
set refresh seconds in php variable "refsec" from config file or you
can hard code it from there itself as
var limit="0:59"
it works even as
var limit="0:60"
var limit="0:120"
Kimmo Laine wrote:
> "phforum" <phforum@gmail.com> wrote in message
> news:1153110121.767482.70030@p79g2000cwp.googlegroups.com...
> > Hi,
> >
> > I wrote a PHP page for user input the information to search the
> > database. And the database data will update every second. I want to
> > set the auto refresh to get the data from database every minute. But
> > the page always display the dialog box ask me to resend the
> > information. How to disable this warning message. I using POST and
> > REQUEST to get the data from user input page.
>
>
> Use GET instead of POST.
>
> And for the people who commented, please don't take this the wrong way, but
> you can shove the ajax up your ass.
>
> --
> "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
> spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|