1

I use httpful to send http request and get the response to display in request.php

include('httpful.phar');

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

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

In response.php, I use header to redirect the request to another page, but I cannot get the expected response.

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

echo 'internal response page'

I have also tried

header("HTTP/1.1 302 Found");

but it still only get the response 'internal response page'

what is the correct way to redirect/forward the request to other_response.php?

CL So
  • 3,647
  • 10
  • 51
  • 95

1 Answers1

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.

lepel100
  • 579
  • 1
  • 5
  • 11