Edgar
Edgar

Reputation: 1131

php/jquery - how can i pass post values cross domain with redirect?

I want to pass my post values using php or ajax. After some research i tried doing something like so:

 header('Location: other_page.com', TRUE, 307);

But this did not work. Any suggestions? Do i have to use sessions?

Upvotes: 0

Views: 156

Answers (1)

KillerX
KillerX

Reputation: 1466

You need to append the data you want to send as part of the url (GET). Redirect headers do not support POST "redirects".

This may or may not work in your situation depending on how much data you want to send to the other page.

If you are submitting a form please also note that if you add the "action" attribute to to the form element you are able to specify a different domain and the POST request will go there directly.

Upvotes: 1

Related Questions