Displaying form data in a post
-
Starting out, I created a couple bear-bones Page templates. One served as a form (several lines of text input) and the other template pulls that data in order to echo it and populate the page. In WordPress, I created 2 pages, each one using one of the templates i created, and they work fine.
Now, I want to do this same thing in posts (for easier addition of new) but it doesn’t work. Is PHP crippled in posts?
The form is showing up fine in Post1, and the data is being sent to Post2 properly (it shows up in the url: post2?data1=X1&data2=Y… etc.) but the data isn’t being populated into the post itself.
This is the code I’m using to pull and display the form data:
<?php $word1 = $_GET['word1']; echo htmlspecialchars($word1, ENT_QUOTES, 'UTF-8'); ?>
The topic ‘Displaying form data in a post’ is closed to new replies.