• Resolved n2fisher

    (@n2fisher)


    I’ve beaten by head against the wall for a while and can’t figure this out, so I’d appreciate a pointer or two ..

    Attempting to create a template page for my theme that puts a “contact us” form on the page. Seems pretty straightforward; I’ve done lots of these outside of wordpress, but haven’t done too much wordpress coding, so I’m just missing something.

    My form tag looks like this:

    <form action=”<?= $myurl ?>” method=”post” name=”myForm” id=”myForm”>

    I’ve tried all kinds of things for $myurl .. from index.php to index.php?p=626 to .. ? When the user submits the form they go to the “single post” template with a comment “Sorry, no posts matched your criteria”.

    I had it work a few times, but was never able to reliably repeat it.

    I’m trying to do this because I haven’t been able to find any plugins that do what I want .. I’m developing a school site, so I have 20 teachers. I want the user who comes through a “contact us” form to be able to select one of the 20 teachers to contact. I want someone who is looking at a teacher’s page, and clicks “Contact this teacher” to go to the same form and have pre-selected the teacher to contact.

    I would provide a link to the site, but I’m changing it constantly, so whatever I say here won’t be what you are looking at.

    Any hints on how to get a form to go through to a specific page? This has to be easy to do, I’m just blocking out on seeing how to do it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • you need a plugin that executes code inside of a page or post
    http://wordpress.org/extend/plugins/exec-php/

    Thread Starter n2fisher

    (@n2fisher)

    I don’t think that’s the issue. I’ve created a template file for my theme, and have created a “Contact Norm” page that uses that template. so instead of executing “page.php” I’m executing “contact-form.php” in my theme directory .. I get the page to plot just fine; it’s just when I click submit I don’t get back to the page that I was on.

    Coding at the top of the page will extract the user submission using the $_POST array, then do something with the information, then plot a message “You have submitted the information below; we will contact you shortly about your request” or some such.

    You could try out my current code (subject to change!) at:

    http://bethanylcs2.org/church/contact-norm/

    I’ve modified single-post.php so that it shows the GET and POST variables, so you can see that what you type in is getting there .. it’s just not getting to the right page!

    Thread Starter n2fisher

    (@n2fisher)

    Turns out it was the particular names that I was using for my input fields. Resolved; works perfectly.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Frustration using forms’ is closed to new replies.