First of all, thanks in advance for everyone's help.

I'm new to this stuff, however I'm catching on fast.

I'm working on a e-commerce app where I send a user's credit card info to a merchant company. I request fields back from from them using php to determine whether the transaction was successful. I then echo to the user whether or not the transaction was sucessful using if else type statements.

If transaction was successful I need to echo a post form with hidden values pulled from a session variable in order to capture user information to store in a database. I'm sending this information to a "off the shelf" php form processing script which sends information to a .csv file and also sends user a autoresponder email.

QUESTION: How do I echo a html post form? I've tried and can't get it to work. I would rather not send information to the php script using the post method with hidden fields, however I don't know another way.

Thanks again....

    You mean something like this?

    echo '<form action="handler.php" method="post">';
    echo '<input type="hidden" name="'. $form_key .'" value="'. $form_value .'" />';
    echo '</form>';
    

      you could use Sessions in the top of your page to hold the value....

      session_start();

      $_SESSION[myFieldName] = "whatever";

      on the do page:

      session_start();

      echo $_SESSION[myFieldName];

      if your trying to echo your post...

      echo $_POST[myFieldname];

      really not to sure what you are asking, so hope that helps....

        What do you actually mean "echo an html post form"? Are you talking about submitting a form using the POST method to a different server? The most robust method way of doing that without too much low-level coding would be with the [man]cURL[/man] extension. Otherwise it's a matter of opening a socket ([man]fsockopen[/man]) writing the HTTP headers and POST body to it, and then reading the response from the other server.

          Write a Reply...