• Hello,
    I’m trying to implement an e-mail contact form that I wrote myself. I have experience with HTML and PHP, and I’ve written plenty of these before (not for WP), but I am running into a problem with this one.

    The contact form is on a page at http://mydomain/Contact
    The form is supposed to be processed by the same script, so I have the form action set to http://mydomain/Contact. I’ve tried using the $_SERVER[‘PHP_SELF’] variable as well, and just /Contact.

    In all of these cases, if the user leaves all of the fields blank, the page acts as it should and prints out the errors saying that required fields were missing.

    However, if the form is filled out correctly, or if the latter two of the 3 required fields are left blank, and the form is submitted, the submit button leads to my 404.php page. I’m not sure why. I am assuming I am providing an incorrect form action, but I can’t figure out what the right one is.

    Any help is greatly appreciated. If a look at the code is needed, please let me know. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Have you tried <form action="/index.php?page_id=XX" method="post"> where XX is the id number of the contact page? This worked for me in a contact form I wrote.

    Thread Starter zkarmi25

    (@zkarmi25)

    Just tried that, still doesn’t work =\
    I’m pretty sure I used the right page id, but I got the number in some roundabout way. Just in case I got the wrong one, how do you get the id?

    If you go to Manage->Pages, hover your mouse over the relevant title of the page and and in the status bar you should see something along the lines of http://domain.com/wp-admin/page.php?action=edit&post=XX where XX again equals the page id.

    If your blog address is in a folder such as “blog” then the form action would be <form action="/blog/index.php?page_id=XX" method="post">

    Thread Starter zkarmi25

    (@zkarmi25)

    I’m wondering, could my problem have to do with the fact that I’m using a Page Template for my contact page, with nothing whatsoever in the textarea on the Edit Page page?

    I have exactly the same problem. Did you solve it at last, zkarmi25?

    Thread Starter zkarmi25

    (@zkarmi25)

    No, unfortunately I have not. I gave up and left it alone for a while. I just upgraded to WP2.7, so I’m hoping I can fiddle around with it and find a solution. If I come up with anything I’ll post it here.

    My contact page installed beautifully, and when I test it, it comes back with “Your message was sent successfully. Thanks.”

    Yet, I receive NO email. What do I do?

    Thread Starter zkarmi25

    (@zkarmi25)

    What are you using, girlpaint? Did you install some plugin? Which one? ‘Cause that’s not what I used, I wrote my script myself.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Contact form problems’ is closed to new replies.