0

I need to post values to a server. The server will respond with a webpage. I do not want to read the response and echo to a page. I only want to post and let the server display by itself. "header(location:bla bla)" is a "get" I can't used it. With Curl or pear, I will need to explode the response and display it (is a no,no). Any other suggestions?

Theodore R. Smith
  • 21,848
  • 12
  • 65
  • 91
user1819551
  • 21
  • 2
  • 7

2 Answers2

1

what about automatically submitting a form (method="POST") with javascript?

low_rents
  • 4,481
  • 3
  • 27
  • 55
1

Your question is hard for me to parse, although I tried my best and I also edited it for others.

I think what you may be looking for is the following. For example, if you wanted to display a plaintext file directly in the browser:

// Do processing above...
header('Content-Type: text/plain');
echo $text;
exit;

This will have your browser output the data as if it were a text document, not an HTML page.

But, say you want to do something more exotic? Like output a PNG image?

header('Content-Type: image/png');
echo $pngData;
exit;

I hope that helps. Search online for MIME Types to find more of these values for other file types.

Theodore R. Smith
  • 21,848
  • 12
  • 65
  • 91