Posting information input to form to another page?

I am working with wordpress and I want to figure out a way to have a form on one page, and then have the information post to a separate page on the site. I only know html so I don’t know how to work through the php at all nor do I know where to put the code to do this.
I already have a generic form set up, I just can’t connect the dots with this and figure out how to display the information back.
I have looked through a dozen or so similar posts, but all of the answers would require that I know more about php. Any help or advice would be appreciated, thank you in advance.

Related posts

Leave a Reply

2 comments

  1. You use PHP’s $_POST to get the values submitted by the form. Set the action attribute of your form to the php page.

    If this is your form:

    <form action="second-page.php" method="post">
    <input name="field_01">
    <button type="submit">Submit</button>
    </form>
    

    You access the value of field_01 in the php like this:

    $_POST["field_01"];
    

    Where field_01 can be the name of any relevant field that was in the form.

    To simplify things, collect all the fields in variables at the top, and echo them when you want to put them in your html:

    <?php
    $field_01 = $_POST["field_01"];
    ?>
    
    <!-- your html -->
    <p><?php echo $field_01; ?></p>
    

    You can do this for as many fields as you have.

  2. Make use of the action attribute in your form to send the inputted data and $_POST to recieve it. You should be able to look up and learn these two things in a few minutes.