How can i redirect to a different page along with passing some POST parameters using PHP ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You cannot “redirect” with the POST method per se, what you’re after is to execute a POST request to the site you were planning to redirect to. Have a look at the cURL POST example from http://php.net/manual/de/book.curl.php:
Substitute the
CURLOPT_URLwith your target and set the required fields in the$dataarray. For this to work your PHP needs to have the cURL module enabled.Alternatively you could store all the data you plan to send in the POST in your session and just have the target read from there.