This question already has an answer here:

I have created a template for form validation and when i run it error says EPIC 404...article not found....I dont know anything about Wordpress so anyone can sort it out how to validate my custom form



if(!empty($fullname) && !empty($age) && !empty($email))
$query="SELECT * FROM wp_mypage WHERE email='$email'";

$query="INSERT INTO wp_mypage ('$fullname','$age','$email')";
header("Location : http://localhost/wordpress/?page_id=67");
$status='Already Subscribed';
header("Location : http://localhost/wordpress/?page_id=73");
$status='Please fill all the fields';
header("Location : http://localhost/wordpress/?page_id=73");

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" >
<input id="name" name="name" type="text"  required>
<input id="name" name="age" type="number" required>
<input id="email" name="email" type="email" required>

<input type="submit" value="Submit" />

I dont know whether to use $_SERVER or redirect to the page-id...

marked as duplicate by fuxia Apr 20 '15 at 4:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please read about using $wpdb, especially $wpdb->prepare(). Your code is an invitation for hackers. – fuxia Apr 20 '15 at 4:52

Do not use variable name "name" for html textbox control, use something else.
This behavior is due to internal handling of WordPress with "name" variable found in query string of posted data.

Not the answer you're looking for? Browse other questions tagged or ask your own question.