I'm doing the validation of the contact form on my site I try to validate via html, recaptcha, and in case of success by php before sending.
Somehow, when the form is correct (after html and recaptcha), instead of refreshing contact.php to validate with php, load inside contact.php my index.php! As a clue, I tell you that the index that loads inside has the broken menu, only appears index (no other page created within wordpress)
My contact.php form:
<form action="" method="POST" >
<h4>Get in <strong>touch</strong>.</h4>
<div class="input-group margin-bottom-sm">
<label for="name">Name</label><input type="text" name="name" placeholder="My name is..." required>
<label for="email">eMail</label><input type="text" name="email" placeholder="My eMail is..." title="The domain portion of the email address is invalid (the portion after the @)." pattern="^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*(\.\w{2,})+$" required>
<label for="subject">Subject</label><input type="text" name="subject" placeholder="My message title is..." required>
<label for="message">Message</label><textarea name="message" class="materialize-textarea" placeholder="My message is..." required></textarea>
</div><!-- input group -->
<div class="g-recaptcha" data-sitekey="6LflazgUAAAAANLnhAXhFn5qFWTER3yDAuDt_upj"></div>
<div class="form-actions"><button type="reset" value="reset" class="btn white-grey"><i class="fa fa-close"></i> Reset</button> <button type="submit" value="submit" class="btn red-pink"><i class="fa fa-send-o"></i> Send</button></div>
</form>
Any ideas I'm doing wrong?