0
如何从另一个网站上的text/php
文件获得URL
,然后打开该URL链接?如何从远程txt/php文件获取URL并加载该URL?
如果没有一个只是默认如default.php
我有机会获得这两个网站,
如何从另一个网站上的text/php
文件获得URL
,然后打开该URL链接?如何从远程txt/php文件获取URL并加载该URL?
如果没有一个只是默认如default.php
我有机会获得这两个网站,
如果我理解正确的话,你想一个网站上请求URL网站B.网站B然后将回应一个URL,你想加载。您可以使用以下内容
<?
$url = 'http://www.siteb.com/givemeaurl.php';
$content = implode('', file($url));//
//$content now contains the response from site B. If its only the URL you can use it directly, else you need to parse the results
if (strlen($content)>0) {
//we have a value
$newurl = $content;
} else {
//no value
$newurl = 'default.php';
}
//no open the new site
header('Location: ' . $newurl);
?>
完美的作品,谢谢堆:) – Benjamin 2013-03-14 11:43:45
使用curl获取数据以从站点B获取数据,然后重定向到链接。 – Hemc 2013-03-14 09:45:12