By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,983 Members | 2,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,983 IT Pros & Developers. It's quick & easy.

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

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


P: n/a

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

P: n/a

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

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

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

P: n/a
"phforum" <ph*****@gmail.comwrote in message
news:11*********************@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
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jul 17 '06 #6

P: n/a

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" <ph*****@gmail.comwrote in message
news:11*********************@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
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Jul 17 '06 #7

P: n/a
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.
js*******@attglobal.net
==================
Jul 17 '06 #8

P: n/a
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.
js*******@attglobal.net
==================
Jul 17 '06 #9

P: n/a
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.
js*******@attglobal.net
==================
Jul 18 '06 #10

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

This discussion thread is closed

Replies have been disabled for this discussion.