2013-03-14 33 views

回答

0

如果我理解正确的话,你想一个网站上请求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); 
?> 
+0

完美的作品,谢谢堆:) – Benjamin 2013-03-14 11:43:45