364,088 Members | 5545 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

How to refresh page without prompt the "resend information...."?

phforum
P: n/a
phforum
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.

Thanks all

Jul 17 '06 #1
Share this Question
Share on Google+
10 Replies


vurtunetech@gmail.com
P: n/a
vurtunetech@gmail.com

phforum wrote:
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.
>
Thanks all
Have you tried to implement AJAX into the script? That would allow you
to keep it all updated without refreshing the page, and in my opinion
would be much better.

Jul 17 '06 #2

dawnerd
P: n/a
dawnerd

phforum wrote:
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.
>
Thanks all
Have you tried to implement AJAX into the script? That would allow you
to keep it all updated without refreshing the page, and in my opinion
would be much better.

Jul 17 '06 #3

Manish
P: n/a
Manish
I used ajax for the same feature

<script language="JavaScript">
window.onload = function(){
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");

setInterval("GetData('<?php echo $postvar1; ?>', '<?php echo
$postvar2; ?>')", 60000)

}
</script>

if you want to change the refresh time dynamically (1 min to say 5 min)


<script language="JavaScript">
function UpdateData() {
clearInterval(dataupdate);
dataupdate = setInterval(UpdateData(),
document.getElementById("refinterval").value);

GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
}

var dataupdate;
window.onload = function(){
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
dataupdate = setInterval(UpdateData(), 60000)
}
</script>

onchange of refinterval : UpdateData()



phforum wrote:
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.
>
Thanks all
Jul 17 '06 #4

phforum
P: n/a
phforum
Hi Manish,

I tried your script. But the page won't auto refresh. (Sorry I am a
php newbie and no Javascript knowledge) And I press F5 the IE still
prompt the warning message.

Thanks

PH


Manish 寫é“:
I used ajax for the same feature
>
<script language="JavaScript">
window.onload = function(){
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>
setInterval("GetData('<?php echo $postvar1; ?>', '<?php echo
$postvar2; ?>')", 60000)
>
}
</script>
>
if you want to change the refresh time dynamically (1 min to say 5 min)
>
>
<script language="JavaScript">
function UpdateData() {
clearInterval(dataupdate);
dataupdate = setInterval(UpdateData(),
document.getElementById("refinterval").value);
>
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
}
>
var dataupdate;
window.onload = function(){
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
dataupdate = setInterval(UpdateData(), 60000)
}
</script>
>
onchange of refinterval : UpdateData()
>
>
>
phforum wrote:
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.

Thanks all
Jul 17 '06 #5

Kimmo Laine
P: n/a
Kimmo Laine
"phforum" <phforum@gmail.comwrote in message
news:1153110121.767482.70030@p79g2000cwp.googlegro ups.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)


Jul 17 '06 #6

Manish
P: n/a
Manish

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.comwrote in message
news:1153110121.767482.70030@p79g2000cwp.googlegro ups.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)
Jul 17 '06 #7

Jerry Stuckle
P: n/a
Jerry Stuckle
phforum wrote:
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.
>
Thanks all
>
That's a browser issue, not a PHP one. You would have to turn off the
message in the browser's options.

Using GET instead of POST will work. Or you could use javascript to do
the auto-refresh.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Jul 17 '06 #8

Jerry Stuckle
P: n/a
Jerry Stuckle
phforum wrote:
Hi Manish,
>
I tried your script. But the page won't auto refresh. (Sorry I am a
php newbie and no Javascript knowledge) And I press F5 the IE still
prompt the warning message.
>
Thanks
>
PH
>
>
Manish 寫é“:
>
>
>>I used ajax for the same feature
>>
>><script language="JavaScript">
>>window.onload = function(){
>> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>>
>> setInterval("GetData('<?php echo $postvar1; ?>', '<?php echo
>>$postvar2; ?>')", 60000)
>>
>>}
>></script>
>>
>>if you want to change the refresh time dynamically (1 min to say 5 min)
>>
>>
>><script language="JavaScript">
>>function UpdateData() {
> clearInterval(dataupdate);
> dataupdate = setInterval(UpdateData(),
>>document.getElementById("refinterval").value);
>>
> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>>}
>>
>>var dataupdate;
>>window.onload = function(){
>> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>> dataupdate = setInterval(UpdateData(), 60000)
>>}
>></script>
>>
>>onchange of refinterval : UpdateData()
>>
>>
>>
>>phforum wrote:
>>
>>>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.
>>>
>>>Thanks all
>
>
Of course it will. You're telling the browser to refresh, instead of
letting the javascript do it.

Let Manish's script submit the page for you instead of doing it manually.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Jul 17 '06 #9

phforum
P: n/a
phforum
Thanks Manish, Kimmo Laine, Jerry Stuckle three expert.
The problem solved after using GET.
Thanks again. ^_^


Jerry Stuckle 寫é“:
phforum wrote:
Hi Manish,

I tried your script. But the page won't auto refresh. (Sorry I am a
php newbie and no Javascript knowledge) And I press F5 the IE still
prompt the warning message.

Thanks

PH


Manish 寫é“:

>I used ajax for the same feature
>
><script language="JavaScript">
>window.onload = function(){
> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>
> setInterval("GetData('<?php echo $postvar1; ?>', '<?php echo
>$postvar2; ?>')", 60000)
>
>}
></script>
>
>if you want to change the refresh time dynamically (1 min to say 5 min)
>
>
><script language="JavaScript">
>function UpdateData() {
clearInterval(dataupdate);
dataupdate = setInterval(UpdateData(),
>document.getElementById("refinterval").value);
>
GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
>}
>
>var dataupdate;
>window.onload = function(){
> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
> dataupdate = setInterval(UpdateData(), 60000)
>}
></script>
>
>onchange of refinterval : UpdateData()
>
>
>
>phforum wrote:
>
>>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.
>>
>>Thanks all
>
Of course it will. You're telling the browser to refresh, instead of
letting the javascript do it.
>
Let Manish's script submit the page for you instead of doing it manually.
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Jul 18 '06 #10

Mladen Gogala
P: n/a
Mladen Gogala
Kimmo Laine wrote:
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.
>
M y sentiments exactly, with one minor correction: there is only one
way to shove something up somebody's rear, so it cannot be "taken the
wrong way".

--
Mladen Gogala
http://www.mgogala.com
Jul 18 '06 #11

Post your reply

Help answer this question



Didn't find the answer to your PHP question?

You can also browse similar questions: PHP