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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • phforum

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

    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

  • vurtunetech@gmail.com

    #2
    Re: How to refresh page without prompt the "resend information.... "?


    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.

    Comment

    • dawnerd

      #3
      Re: How to refresh page without prompt the "resend information.... "?


      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.

      Comment

      • Manish

        #4
        Re: How to refresh page without prompt the "resend information.... "?

        I used ajax for the same feature

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

        setInterval("Ge tData('<?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="JavaS cript">
        function UpdateData() {
        clearInterval(d ataupdate);
        dataupdate = setInterval(Upd ateData(),
        document.getEle mentById("refin terval").value) ;

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

        var dataupdate;
        window.onload = function(){
        GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
        dataupdate = setInterval(Upd ateData(), 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

        Comment

        • phforum

          #5
          Re: How to refresh page without prompt the &quot;resend information.... &quot;?

          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="JavaS cript">
          window.onload = function(){
          GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
          >
          setInterval("Ge tData('<?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="JavaS cript">
          function UpdateData() {
          clearInterval(d ataupdate);
          dataupdate = setInterval(Upd ateData(),
          document.getEle mentById("refin terval").value) ;
          >
          GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
          }
          >
          var dataupdate;
          window.onload = function(){
          GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
          dataupdate = setInterval(Upd ateData(), 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

          Comment

          • Kimmo Laine

            #6
            Re: How to refresh page without prompt the &quot;resend information.... &quot;?

            "phforum" <phforum@gmail. comwrote in message
            news:1153110121 .767482.70030@p 79g2000cwp.goog legroups.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@bhg byrzcv.arg)


            Comment

            • Manish

              #7
              Re: How to refresh page without prompt the &quot;resend information.... &quot;?


              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:second s" Minutes should range from 0
              to inifinity. Seconds should range from 0 to 59
              var limit="0:<?php echo $refsec ?>"

              if (document.image s){
              var parselimit=limi t.split(":")
              parselimit=pars elimit[0]*60+parselimit[1]*1
              }

              function beginrefresh(){
              if (!document.imag es) {
              return
              }
              if (parselimit==1) {
              window.location .reload()
              } else {
              //get the minutes, seconds remaining till next refersh
              parselimit-=1
              curmin = Math.floor(pars elimit/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=c urtime
              //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("beg inrefresh()",10 00)
              }
              }
              //call the function beginrefresh
              window.onload=b eginrefresh
              //-->
              </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@p 79g2000cwp.goog legroups.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@bhg byrzcv.arg)

              Comment

              • Jerry Stuckle

                #8
                Re: How to refresh page without prompt the &quot;resend information.... &quot;?

                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@attgl obal.net
                =============== ===

                Comment

                • Jerry Stuckle

                  #9
                  Re: How to refresh page without prompt the &quot;resend information.... &quot;?

                  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="JavaS cript">
                  >>window.onlo ad = function(){
                  >> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                  >>
                  >> setInterval("Ge tData('<?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="JavaS cript">
                  >>function UpdateData() {
                  > clearInterval(d ataupdate);
                  > dataupdate = setInterval(Upd ateData(),
                  >>document.getE lementById("ref interval").valu e);
                  >>
                  > GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                  >>}
                  >>
                  >>var dataupdate;
                  >>window.onlo ad = function(){
                  >> GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                  >> dataupdate = setInterval(Upd ateData(), 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
                  >>>informatio n. 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@attgl obal.net
                  =============== ===

                  Comment

                  • phforum

                    #10
                    Re: How to refresh page without prompt the &quot;resend information.... &quot;?

                    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="JavaS cript">
                    >window.onloa d = function(){
                    > GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                    >
                    > setInterval("Ge tData('<?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="JavaS cript">
                    >function UpdateData() {
                    clearInterval(d ataupdate);
                    dataupdate = setInterval(Upd ateData(),
                    >document.getEl ementById("refi nterval").value );
                    >
                    GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                    >}
                    >
                    >var dataupdate;
                    >window.onloa d = function(){
                    > GetData("<?php echo $postvar1; ?>", "<?php echo $postvar2; ?>");
                    > dataupdate = setInterval(Upd ateData(), 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@attgl obal.net
                    =============== ===

                    Comment

                    • Mladen Gogala

                      #11
                      Re: How to refresh page without prompt the &quot;resend information.... &quot;?

                      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

                      Comment

                      Working...