Redirect a URL with Post data
php, post
Solution
I did it using a form and JS
On page 1
<?php
$chars="stackoverflowrules";
?>
<html>
<form name='redirect' action='page2.php' method='POST'>
<input type='hidden' name='chars' value='<?php echo $chars; ?>'>
<input type='submit' value='Proceed'>
</form>
<script type='text/javascript'>
document.redirect.submit();
</script>
</html>
On page 2
<?php
$token = $_POST['chars'];
echo $token;
?>
Problem
I want to redirect a user from page1 to page2 with some POST data .Page1 and page2 are on two different domains and i have control over both of them Page 1 ``` <?php $chars="stackoverflowrules" ?> ``` I want to submit the chars as a post data and the redirect to page 2. Then one page 2 i want to use the POST data like ``` <?php $token = $_POST['chars']; echo $token; ?> ```