-5

I want to know that how to send a response using header in php . When an application or an User hit my URL then i have to send a response header with response 1 for failure and 0 for success, and if the response is success (0) then i have to send two values in response header.

Sam
  • 7,252
  • 16
  • 46
  • 65
  • Sorry if i am wrong, but thats http://www.php.net/manual/de/function.header.php the only way to modify your response header. – Tyralcori Jun 10 '14 at 13:38
  • 1
    I suggest you use the proper status code instead of "1 for failure and 0 for success". http://stackoverflow.com/a/6164319/362536 – Brad Jun 10 '14 at 13:38

1 Answers1

1

The header function will allow you to set a header.

header("foo", 1);

… but it sounds like you are reinventing HTTP status codes.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • 2
    Also, if you must invent your own headers, use `X-Foo`... prefix your own custom headers with `X-`. – Brad Jun 10 '14 at 13:39