I am trying to forward data from one page to another without using cURL, is this possible?
At the moment i have tried
header('HTTP/1.1 307 Temporary Redirect');
header('Location: new-location.php');
This works nicely but gives a stupid pop up box, any other methods?
I have tried using curl but nothing happens, not sure if its enabled on my server!
I think following is the only possible way to achieve that, instead of redirecting with location header, send this html:-
<!DOCTYPE html>
<html>
<body onload="document.forms[0].submit()">
<form action="new-location.php" method="post">
<?php foreach( $_POST as $key => $val ): ?>
<input type="hidden" name="<?= htmlspecialchars($key, ENT_COMPAT, 'UTF-8') ?>" value="<?= htmlspecialchars($val, ENT_COMPAT, 'UTF-8') ?>">
<?php endforeach; ?>
</form>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With