-1

Like what header("Location http://url.to/"); does, I want to make a redirection but with POST method. I know that cURL can handle sending data by POST/GET method but I'm not sure about redirection.

Helps are appreciated.

revo
  • 47,783
  • 14
  • 74
  • 117

1 Answers1

1
header("HTTP/1.1 307 Temporary Redirect");
header("Location: http://www.***.co.uk/site/index.php");

That will re-direct POST data, see my previous answer here: https://security.stackexchange.com/questions/39564/how-do-i-capture-post-data-then-forward-user-to-another-page/39568#39568

Community
  • 1
  • 1
Scott Helme
  • 4,786
  • 2
  • 23
  • 35
  • Does that method pass on the POSTED variables to the other site, or just same them on the DB of the first site?? – RiggsFolly Aug 23 '13 at 14:37
  • No there is additional code shown in the answer on the other site to save them. The snippet provided here will just redirect the POST request to the new site. Some browsers will warn the user, some will not. – Scott Helme Aug 23 '13 at 14:53
  • Surely thats not a great solution if users get strange warning? – RiggsFolly Aug 23 '13 at 15:04
  • If you take the user's POST data (possibly username/password) and then redirect them to another site the browser *should* tell them. As you can see in my linked answer it allows the invisible theft of details. If you are linking to the same domain and not a different domain, there is no warning because it is safe as you were already sending your information there anyway. – Scott Helme Aug 23 '13 at 15:08