• Resolved doodlz

    (@doodlz)


    I’m using WordPress as a CMS for a business site. I’ve created an info request form on a Page using formmail.php. Does anyone know which directory I should put the formmail.php file for it to be accessed by the form?

    I’ve tried putting it in my theme’s directory and, at a separate time, the root of the site. In both cases, once I’ve filled out and sent the form, instead of taking me to my “thank you” Page, it says, “Sorry, no posts matched your criteria.” I also noticed, the url is “https://mysite.com/request-info/formmail.php” instead of “https://mysite.com/request-info/thank-you” So apparently it’s looking for the formmail.php file under the request-info Page, as if it was a Sub-Page or in that directory, which is why it’s not working. So how can my form access formmail?

    Thanks

Viewing 15 replies - 1 through 15 (of 16 total)
  • Dunno, but any of the “formmail” scripts are about as insecure as anything can be.

    Take a look at dagondesigns form mailer: https://www.dagondesign.com/articles/secure-form-mailer-plugin-for-wordpress/

    It can be customized etc. fairly easily and is quite secure.

    Thread Starter doodlz

    (@doodlz)

    Thanks for the quick reply. I tried using the dagon form mailer, but it’s not as customizable as I want it to be. I have one very long field label which I can’t style correctly, and I can’t create my own classes and ids or take out certain elements such as required fields. I guess I’ll have to use it if I can’t find the answer to this post though.

    Well, only other thing I can tell you is that on a couple of sites I use a HIGHLY customized php contact script – but it’s not used within wp, it’s set up as a separate file outside of wp.

    Ditto here – I have my own very customized form that I use. It’s just linked into WordPress, not really a part of it.

    Thread Starter doodlz

    (@doodlz)

    Oh, do you both have a form on a static html page, say, in your site’s root folder? Or is it still set up as php, just outside WP? I’m a bit new at php so if I could create an html page that would be ideal.

    I guess that’s the way to solve this problem. Will have to figure out how to do that. Thanks for the insight.

    Yes, any time I use this solution (for whatever reason – and there are several differing scenarios) I simply put the contact form in site root (or in a logical subfolder depending on domain necessities) and absolute-link to it from within wp.

    Yes, what she said. Although I will also use a PHP include so I can pull in the header, sidebar and footer from WordPress – so I don’t have to change the contact form separately form the regular site (like when I add links ro change a graphic or something).

    Yup, should have said…. what I do as well using the wp-blog-header.php line at the top of the page so I can use the bits of wp needed….

    Thread Starter doodlz

    (@doodlz)

    Ah, great, thanks to both of you. Yeah I think I’ll attempt to do that, seems like the way to fix this. I’ll see if I can get it to work.

    Well, if you get stuck, post back…. just use this same thread, ‘kay?

    Thread Starter doodlz

    (@doodlz)

    Okay, tried several things, and yes, I’m stuck. Not sure which wp-blog-header.php line you’re referring to in order to utilize the WP bits. If I included the entire wp-blog-header php statement, the page that comes up when I click on my request-info link, says you of course need the wp-config file. And it fails to find the template-loader.php file. So I need help with that.

    Also, I’ve used this <?php include ('header.php'); ?> (as well as include sidebar.php and footer.php, respectively) in the code. When I click on the link to the request-info page, the form comes up but it can’t locate the header, sidebar, footer. It says it isn’t found in the request-info.php directory, which of course it won’t be found there. Now I put the request-info.php in my theme directory. I’m assuming that is part of the problem. Not sure where to put those files (request-info.php, thankyou.php, and formmail.php) and how to have the request-info.php file call the various templates.

    I hope this makes sense. I’m just not sure how to structure my request-info page and what to include in it.

    The particular blog header call I use goes like this:

    <?php require('/path-to-wp/wp-blog-header.php') ?>

    That needs to be the actual SERVER path to your installation of wordpress. Your host support is the best option to get the real deal for that, because there are any number of permutions depending on OS and server setup; and it needs to reside at the very top of the file, before anything, even the doctype.

    The other things you tried will only work if you have the correct server-path in the blog header call.

    [And apologies for maybe being among the missing today – pretty bad when it takes practically all day just to go to town to get your hair done…. 80 mile round trip, so of course we do a bunch of other stuff while there!]

    Thread Starter doodlz

    (@doodlz)

    Thanks for being such a big help. I’m currently asking my host about the server path.

    Thread Starter doodlz

    (@doodlz)

    Yay, the form is up and works. Thanks for all your help vkaryl and doodlebee!

    Glad you got it sorted, have fun!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘How to use formmail.php with WordPress’ is closed to new replies.