首页 > 解决方案 > 使用 WordPress 处理表单 POST 数据

问题描述

我很难弄清楚如何接收表单数据。这就是我的表单的样子:

<form action="register" method="POST">
 <input type="hidden" name="action" value="process_form">
 <input type="email" placeholder="Enter email" name="email">
 <input type="password" placeholder="Enter password" name="password">
</form>

如何访问我的表单数据?

标签: wordpress

解决方案


提交表单后,您可以在使用 PHP $_POST变量加载的页面上访问它。

例如。

$email = $_POST['email'];

请记住验证和清理此变量,因为它将是用户输入的内容。


推荐阅读