0

Is there a way to refresh the $url variable? I would like to pull data from that link every 2 minutes or so. I am using a php include('marquee.php') tag on the page that I would like the marquee to be displayed. I understand the marquee tag needs a lot of work to be smooth, but for now this works for what I'm trying to accomplish. The Marquee is working great, the problem is if I try to use a

<meta http-equiv='refresh' content='120' />;

in marquee.php page, when the content refreshes, it also refreshes the entire page that the marquee is being displayed on. How can I prevent the page that is displaying the marquee from being refreshed? I am open to other/better ways to get this done, Thank you in advance!

marquee.php

$url="http://www.somesite.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec ($ch);

//extracting the data that I need and echoing it through a marquee tag

echo '<marquee>'; 
    $number = 0;
    $i = 0;
    while($number<=16){
    echo $teamAr[$i++].')&emsp;&emsp;&emsp;';

           $number++; 
    }

echo       '</marquee>';

1 Answer 1

2

cURL will not help you. If you want to update conetent on your page without a refresh, your only option is AJAX.

Sign up to request clarification or add additional context in comments.

2 Comments

How do I use ajax to pull content from a sites page?
That is a whole new area of research you will embark on. There are probably hundreds of thousands of examples of how to use AJAX to update page content on the web and StackOverflow, first however, I would suggest that you gain an understanding of server vs. client side programming for the web and get a feel for when each is needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.