开发者

Wordpress Php print / echo input results from previous page

I am trying to create a php function in wordpress where a user answers a question on one page and then prints their answer on the next page after they hit submit.

The data does not need to be collected in开发者_开发知识库 a database just printed so it shows what the user typed.

Thanks in advance!


You could use a form to do this. Create HTML form with an input for the answer that gets submitted to a php file on submit:

<form action="print.php" method="POST">
     <input type="text" name="user_answer" />
     <input type="submit" value="answer question!" />
</form>

Then have a PHP file (called print.php in this example);

$answer = $_POST['user_answer'];
echo $answer;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜