2013-03-14 68 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