$_POST 在 wordpress 中提交表单时返回空

San*_*hra 4 php forms wordpress post

我有一个表格:

<form action="<?php echo the_permalink(); ?>" method="POST">
    <input type="text" name="name" value="" placeholder="Your First and Last Name *" />
    <?php echo $firstnameError; ?>
    <input type="text" name="email" value="" placeholder="Yoyr Email" />
    <?php echo $emailError; ?>
    <br>
    <input type="text" name="company" value="" placeholder="Your Company Name" />
    <input type="text" name="phone" value="" placeholder="Your Phone number" />
    <textarea name="project" rows="4" cols="50" placeholder="Describe the scope of work and the most important features of the project *'"></textarea>
    <?php echo $addressError; ?>
    <br>
    <input type="radio" name="budget" value="1500" />
    <input type="radio" name="budget" value="2500" />
    <input type="radio" name="budget" value="5000" />
    <input type="radio" name="budget" value="10000" />
    <input type="radio" name="budget" value="100001" />
    <input type="radio" name="budget" value="not sure" />
    <input type="hidden" name="submit" value="1" />
    <input type="submit" value="SUbmit" />
</form>
Run Code Online (Sandbox Code Playgroud)

它对同一页面进行操作,但是当我这样做时,print_r($_POST);它不会打印任何内容,即$_POST.

这可能是什么原因?我在这方面研究了一些关于 SO 的问题,但没有一个给我我正在寻找的答案。

Mar*_*rty 5

如果您将名称作为 Post 值传递,wordpress DOSNT 就像这样!

改变这个

<input type="text" name="name" value="" placeholder="Your First and Last Name *" />
Run Code Online (Sandbox Code Playgroud)

<input type="text" name="thename" value="" placeholder="Your First and Last Name *" />
Run Code Online (Sandbox Code Playgroud)

name更改为thename,将保证工作!;)