1

httpful を使用して http リクエストを送信し、request.php に表示するレスポンスを取得します。

include('httpful.phar');

$response = \Httpful\Request::get('http://domain/response.php')->send();

echo '<textarea rows="20" cols="100">';
echo $response;
echo '</textarea>';

response.php では、ヘッダーを使用してリクエストを別のページにリダイレクトしていますが、期待どおりの応答が得られません。

header("HTTP/1.1 301 Moved Permanently");
header("Location:http://otherdomain/other_response.php");

echo 'internal response page'

私も試してみました

header("HTTP/1.1 302 Found");

しかし、それでも「内部応答ページ」という応答しか得られません

リクエストをother_response.phpにリダイレクト/転送する正しい方法は何ですか?

4

1 に答える 1

0

From what I know, you may only use header(); once. And it has to output before anything else. From the code that you showed, I don't see any mistakes besides that.

于 2013-10-18T09:28:20.220 に答える