• Resolved majost

    (@majost)


    I’ve been using WP 2.0.1 and Exec-PHP to try and create a Contact form on a Static WP Page that is accessed through a permalink. However, I can’t seem to pass the $_POST variable back to it.

    I’m trying as simple code as possible to get this to work, and it’s still coming up with a 404 when I try to submit. Here’s my code:

    <?php if ($_POST[email]=="") { ?>
    <form action="/contact" method="post">
    <input type="text" name="author" size="22" />
    <input type="text" name="email" size="22" />
    <textarea name="comment" cols="100%" rows="10"></textarea>
    <input name="submit" type="submit" value="Submit" />
    </form>
    <?php } else {
    print_r($_POST);
    }

    I tried looking around, and found a few things, but it seems as though people have generally had success with this kind of thing. Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Use a custom Page template. It’s a lot easier (and better) than using a PHP plugin.

    Or you could use this plugin:

    https://ryanduff.net/projects/wp-contactform/

    Thread Starter majost

    (@majost)

    Hm… a marvelous two suggestions. Thanks, I’ll look into those.

    Thread Starter majost

    (@majost)

    OK, I tried the custom page template, and I’m still having difficulty in getting it to work. It’s just returning a 404 every time there’s post data sent along with otherwise valid links.

    Thread Starter majost

    (@majost)

    Aha! I figured it out. I had ‘author’ as one of my variables I was passing. Apparently WordPress and K2 don’t like that very much, since it works without that variable.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Accessing $_POST in a WordPress Page’ is closed to new replies.