0

有没有办法刷新 $url 变量?我想每 2 分钟左右从该链接中提取数据。我在希望显示选取框的页面上使用 php include('marquee.php') 标记。我知道选框标签需要做很多工作才能顺利进行,但现在这适用于我想要完成的工作。Marquee 运行良好,问题是如果我尝试使用

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

在 marquee.php 页面中,当内容刷新时,它也会刷新显示选取框的整个页面。如何防止显示选取框的页面被刷新?我愿意接受其他/更好的方法来完成这项工作,在此先感谢您!

选框.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>';
4

1 回答 1

2

cURL 不会帮助你。如果您想在不刷新的情况下更新页面上的内容,您唯一的选择是 AJAX。

于 2012-11-06T01:30:36.523 回答