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.
Leave a Reply
You must be logged in to post a comment.
You use PHP’s
$_POST
to get the values submitted by the form. Set theaction
attribute of your form to the php page.If this is your form:
You access the value of
field_01
in the php like this: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:You can do this for as many fields as you have.
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.