refresh page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajesh0811
    New Member
    • Dec 2006
    • 3

    refresh page

    Hi,
    I have just started using PHP and am from a non computing background. But i wanted to learn a bit of programming so started with PHP.

    i was just trying to make a integration tool, using PHP, JavaScript and HTML.
    to explain the senario,

    i am submitting user data to multiple web servers as query and extracting output to display it to the user.
    for this i am using cURL. But one of the pages needs to be refreshed continously to get the final result.

    i searched the net to help me out but most of the places give me codes to refresh a html page

    i was wondering if i could do that with php or best using cURL.

    thanks
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by rajesh0811
    Hi,
    I have just started using PHP and am from a non computing background. But i wanted to learn a bit of programming so started with PHP.

    i was just trying to make a integration tool, using PHP, JavaScript and HTML.
    to explain the senario,

    i am submitting user data to multiple web servers as query and extracting output to display it to the user.
    for this i am using cURL. But one of the pages needs to be refreshed continously to get the final result.

    i searched the net to help me out but most of the places give me codes to refresh a html page

    i was wondering if i could do that with php or best using cURL.

    thanks
    Have you looked at an Ajax type of solution for this problem? Or another method using HTTPRequest?

    Ronald :cool:

    Comment

    • mainul
      New Member
      • Sep 2006
      • 51

      #3
      hi

      put the code inside <Head> tag

      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <META HTTP-EQUIV="Refresh" CONTENT=120>

      in the code CONTENT=120 value indicate after how many seconds you want to refresh the page. change it according to ur requirement.

      best regards,
      Mainul

      Comment

      • subash
        New Member
        • Sep 2006
        • 32

        #4
        Hi,

        I think AJAX methods (Its simple to learn and implement) will be helpful for this.

        Comment

        • rajesh0811
          New Member
          • Dec 2006
          • 3

          #5
          Thanks a lot guys for helping.......
          I will surely have a look at Ajax...
          I cannot use the <meta> solution...becu ase i dont want to refresh all the pages that i access only 2 of them....... as this web page accessess and executes different tools available over the internet. It displays all these results in different tabs....incase i use the meta solution it will keep refreshing the whole page which is unnecessary.... .i guess....i will try AJAX though and have a look and let you guys know if it is ok

          Comment

          • rajesh0811
            New Member
            • Dec 2006
            • 3

            #6
            i think a code sample will give you guys a better understanding
            [php]
            if ($_POST['searchType'] == 'xxx') {
            if(isset($_SESS ION['xxx_out']) &&
            isset($_SESSION['xxx_input']) &&
            $_SESSION['xxx_input'] == $_POST['usr data']) /* usr submitted data */
            {
            print $_SESSION['xxx_out']; /* display output */
            } else {

            $n = ($_POST['usr data']);
            $_SESSION['xxx_usr data'] = ($_POST['Sequence']); /* submitted usr data */

            $ch = curl_init(); /* initiate curl */

            curl_setopt($ch , CURLOPT_URL, "url"); /* set target url */

            curl_setopt($ch , CURLOPT_POST, 1); /* insert number of parameters to POST */

            curl_setopt($ch , CURLOPT_POSTFIE LDS, "n1=v1&n2=v 2"); /* write parameter name and its value for curl to submit */

            curl_setopt ($ch, CURLOPT_RETURNT RANSFER, true);

            "I WANT TO WRITE A CODE HERE TO REFRESH THIS PAGE ONLY there are around 10 code on similar lines but only this piece has to be refreshed so i cant use the meta solution"

            $_SESSION['xxx_out'] = curl_exec($ch);
            print $_SESSION['xxx_out'];

            curl_close($ch) ;
            }[/php]
            Last edited by ronverdonk; Dec 30 '06, 11:11 PM. Reason: code enclosed in tags

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              Please read the Posting Guidelines before you post in this forum!.
              Especially the part about enclosing any code within code, html or php tags.

              moderator :cool:

              Comment

              Working...