user2129623
user2129623

Reputation: 2257

Post data in header location with post method

We can send data to another file using header location:

header(location: payment.php?email=$email);

And receive:

$email = $_GET['email'];

But as I want to send some important credential, I dont want to use GET. Is there any way to do it using POST?

I can not use session, so please ignore it

Upvotes: 2

Views: 5621

Answers (1)

Satish Sharma
Satish Sharma

Reputation: 9635

try this auto submit form

<?php
if(isset($email))
{
    ?>
    <form name="myForm" id="myForm"  action="payment.php" method="POST">
            <input name="email" value="<?php echo $email;?>" />
    </form>

    <script>
    function submitform()
    {
      document.getElementById("myForm").submit();
    }
    window.onload = submitform;
    </script>
<?php
}
    ?>

Upvotes: 4

Related Questions