1

Is there a way to send POST data using HTTP headers without a form from PHP?

5
  • 1
    PHP runs on the server side. Do you mean "from javascript"? Commented May 1, 2012 at 1:38
  • is something like this what ur looking for? [Post to a page using PHP header function][1] [1]: stackoverflow.com/questions/653090/… Commented May 1, 2012 at 1:38
  • I know php is server side, but you can set headers. EX: header("location: google.com") Commented May 1, 2012 at 1:39
  • Like cURL you mean? php.net/manual/en/book.curl.php Commented May 1, 2012 at 1:41
  • Sort of, except my host won't allow adding extensions to the PHP installation; is there any way to send a value without using a form, $_GET, $_SESSION, $_COOKIES (I don't want it to be saved or shown anywhere) Commented May 1, 2012 at 1:45

1 Answer 1

3

Sure, you can create a valid http request with your specified POST parameters easily using a library like cURL.

See this for a curl example

If you are limited to plain PHP you can create your own (valid) http-request, see example

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.