niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » PHP
How to refresh page without prompt the "resend information...."?
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
Author Message
phforum
*nix forums beginner


Joined: 09 Jul 2006
Posts: 5

PostPosted: Mon Jul 17, 2006 4:22 am    Post subject: How to refresh page without prompt the "resend information...."? Reply with quote

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
Back to top
vurtunetech@gmail.com
*nix forums beginner


Joined: 17 Jul 2006
Posts: 1

PostPosted: Mon Jul 17, 2006 4:36 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

phforum wrote:
Quote:
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.
Back to top
dawnerd
*nix forums beginner


Joined: 17 Jul 2006
Posts: 2

PostPosted: Mon Jul 17, 2006 4:36 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

phforum wrote:
Quote:
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.
Back to top
manish
*nix forums addict


Joined: 26 May 2005
Posts: 68

PostPosted: Mon Jul 17, 2006 5:21 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

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:
Quote:
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
Back to top
phforum
*nix forums beginner


Joined: 09 Jul 2006
Posts: 5

PostPosted: Mon Jul 17, 2006 6:34 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

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 寫道:

Quote:
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
Back to top
Kimmo Laine
*nix forums Guru Wannabe


Joined: 25 Mar 2005
Posts: 209

PostPosted: Mon Jul 17, 2006 7:22 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

"phforum" <phforum@gmail.com> wrote in message
news:1153110121.767482.70030@p79g2000cwp.googlegroups.com...
Quote:
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)
Back to top
manish
*nix forums addict


Joined: 26 May 2005
Posts: 68

PostPosted: Mon Jul 17, 2006 7:40 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

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:
Quote:
"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)
Back to top
Jerry Stuckle
*nix forums Guru


Joined: 24 Feb 2005
Posts: 1515

PostPosted: Mon Jul 17, 2006 10:52 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

phforum wrote:
Quote:
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
==================
Back to top
Jerry Stuckle
*nix forums Guru


Joined: 24 Feb 2005
Posts: 1515

PostPosted: Mon Jul 17, 2006 10:54 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

phforum wrote:
Quote:
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
==================
Back to top
phforum
*nix forums beginner


Joined: 09 Jul 2006
Posts: 5

PostPosted: Tue Jul 18, 2006 2:05 am    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

Thanks Manish, Kimmo Laine, Jerry Stuckle three expert.
The problem solved after using GET.
Thanks again. ^_^


Jerry Stuckle 寫道:

Quote:
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
==================
Back to top
Mladen Gogala
*nix forums Guru


Joined: 11 Mar 2005
Posts: 948

PostPosted: Tue Jul 18, 2006 2:57 pm    Post subject: Re: How to refresh page without prompt the "resend information...."? Reply with quote

Kimmo Laine wrote:

Quote:
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
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [11 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 6:41 am | All times are GMT
navigation Forum index » Programming » PHP
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Insert header and footer in every page served by proxy ehmedk Apache 0 Tue Apr 22, 2008 6:27 pm
No new posts Insert header and footer in every page served by squid ehmedk Squid 0 Tue Apr 22, 2008 6:16 pm
No new posts Capturing user login Information of windows sachin PHP 3 Fri Jul 21, 2006 5:44 am
No new posts Dev Database Refresh Options meathammer Server 3 Wed Jul 19, 2006 10:05 pm
No new posts online man page Ralph.Lam@gmail.com shell 0 Wed Jul 19, 2006 8:28 am

Debt Consolidation | Watch Anime Free Online | Novela romantica | Credit Cards | Payday Loans
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2065s ][ Queries: 16 (0.0869s) ][ GZIP on - Debug on ]