@aniya.jaskolski
To pass a $_POST variable from a redirect page, you can use sessions or URL parameters.
1 2 |
session_start(); $_SESSION['post_data'] = $_POST; |
Then, redirect to the second page:
1 2 |
header("Location: second-page.php"); exit(); |
In the second page, retrieve the $_POST variable from the session:
1 2 |
session_start(); $post_data = $_SESSION['post_data']; |
1 2 3 |
$post_data = http_build_query($_POST); header("Location: second-page.php?" . $post_data); exit(); |
In the second page, retrieve the $_POST variable from the URL:
1
|
$post_data = $_GET; |
Choose the method that best suits your needs and implement it in your redirect page.