我已经为表单验证创建了一个模板,当我运行它时,错误显示为EPIC 404。。。未找到文章。。。。我对Wordpress一无所知,所以任何人都可以解决如何验证我的自定义表单
<?php
if(isset($_POST[\'submit\']))
{
$fullname=$_POST[\'fullname\'];
$age=$_POST[\'age\'];
$email=$_POST[\'email\'];
if(!empty($fullname) && !empty($age) && !empty($email))
{
$dbc=mysqli_connect(\'localhost\',\'root\',\'root\',\'wordpress\');
$query="SELECT * FROM wp_mypage WHERE email=\'$email\'";
$result=mysqli_query($dbc,$query);
$data=mysqli_fetch_array($result);
$val=mysqli_num_rows($data);
if($val==0)
{
$query="INSERT INTO wp_mypage (\'$fullname\',\'$age\',\'$email\')";
mysqli_query($dbc,$query);
header("Location : http://localhost/wordpress/?page_id=67");
}
else
{
$status=\'Already Subscribed\';
header("Location : http://localhost/wordpress/?page_id=73");
}
}
else
{
$status=\'Please fill all the fields\';
header("Location : http://localhost/wordpress/?page_id=73");
}
mysqli_close($dbc);
}
?>
<form action="<?php echo $_SERVER[\'PHP_SELF\']; ?>" method="post" >
Name
<input id="name" name="name" type="text" required>
<br>Age
<input id="name" name="age" type="number" required>
<br>Email
<input id="email" name="email" type="email" required>
<input type="submit" value="Submit" />
</form>
我不知道是使用$\\u服务器还是重定向到page-id。。。