Online Graph in website

Discussion in 'PHP' started by rrn, Apr 19, 2009.

  1. #1
    hi all ,

    in my website there is a graph showing some values . that graph is taken from some other site named www.xxxx.com

    graph is displayed . but the problem is that. whenever the graph changes in the www.xxxx.com , the change should also reflect in my website.

    change is reflected but only after 3 , 4 hours after the graph changes in www.xxxx.com.

    the change should be reflected at once , how is it possible?
    below shown is the code for updating the graph
    
    <? php
    $ch = curl_init("http://www.xxxx.com");
    $fp = fopen("location where it is saved", "w");
    
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    
    curl_exec($ch);
    curl_close($ch);
    fclose($fp);
    ?>
    PHP:

    please give a solution..thanks...
     
    rrn, Apr 19, 2009 IP
  2. angielski

    angielski Peon

    Messages:
    57
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How often do you execute this php script? I guess that you have it in cron table with interval period 4h. Just process this php more often.
     
    angielski, Apr 19, 2009 IP
  3. rrn

    rrn Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sorry , i didnt understand you . can you please make it more clear???

    thank you..
     
    rrn, Apr 19, 2009 IP
  4. domvertex

    domvertex Greenhorn

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    angielski means: Go to the hosting's control panel, there see Cron Jobs, and modify its periodicity.
     
    domvertex, Apr 19, 2009 IP