0

I am creating a contact form page. Perhaps I am doing it wrong? I have something like

<?php
// even when I remove this validation block it fails
if (isset($_POST['name'])) {
    // do validation ... 
}

get_header(); 
?>
...
<form id="frmContact" action="<?php the_permalink() ?>" method="post">
    ... 
</form>
... 

I used the same logic in another page and it works ... the URL is correct and if I refresh the page, it works. It just gives 404 on post back

0

Maybe try clearing out the action attribute: action=""

4
  • It still gives 404 ...
    – JM at Work
    Jun 23 '11 at 1:57
  • What values are you posting? It's probably best to namespace them ... especially if you are processing a form so late in game
    – mfields
    Jun 23 '11 at 2:04
  • yes ... I remembered ... I think its the "name" key
    – JM at Work
    Jun 23 '11 at 2:15
  • That would do it :)
    – mfields
    Jun 23 '11 at 2:25
0

Wordpress has something triggered from posting a field with name="name" tried to change it to name="clientname" for example.

1
  • How is that an answer?
    – kaiser
    Jan 23 '13 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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