php - Posting information input to form to another page? -
i working wordpress , want figure out way have form on 1 page, , have information post separate page on site. know html don't know how work through php @ nor know put code this. have generic form set up, can't connect dots , figure out how display information back. have looked through dozen or similar posts, of answers require know more php. or advice appreciated, thank in advance.
you use php's $_post
values submitted form. set action
attribute of form php page.
if form:
<form action="second-page.php" method="post"> <input name="field_01"> <button type="submit">submit</button> </form>
you access value of field_01
in php this:
$_post["field_01"];
where field_01
can name of relevant field in form.
to simplify things, collect fields in variables @ top, , echo
them when want put them in html:
<?php $field_01 = $_post["field_01"]; ?> <!-- html --> <p><?php echo $field_01; ?></p>
you can many fields have.
Comments
Post a Comment