Support » Plugins » Hacks » Edit Web Page

  • Hi everyone!

    I just started using WordPress a few days ago. I heard a lot about it, and that a lot of websites are designed using WordPress, so I thought I’d give it a shot.

    I have a website that has a Contact Form on it. The Contact Form was created using the Contact Form 7 plugin. What I want to do is, use PHP to hit the database and insert the record into it. From a PHP standpoint, I know how to do it, but trying to figure out where and how to do it via WordPress is almost a nightmare. It’s like everything is intertwined together. I’m used to having a .php page which uses another php page as the “action” and editing it that way.

    Is there any way I can accomplish what I am trying to do without exhausting too much effort?

    Thanks in advance!
    Martin

Viewing 3 replies - 1 through 3 (of 3 total)
  • I would recommend this plugin: https://wordpress.org/plugins/contact-form-7-to-database-extension/

    It will add a database so that all contact form submissions can be retrieved and stored in the backend.

    Thread Starter Martin027

    (@martin027)

    Thanks for the plugin link!

    Is there a way I can do this manually? In other words, manually code the contact form myself? I like to know exactly what the code is doing.

    Moderator bcworkz

    (@bcworkz)

    Well, the suggested plugin code is open source, you can see for yourself what it’s doing 😉

    I couldn’t resist, sorry. I know all too well that it can be difficult to follow other’s code. CF7 provides many hooks to allow extending or altering it’s functionality, as the number of CF7 related plugins prove.

    You just need to find a hook to write the form content to a DB table instead of mailing it. ‘wpcf7_before_send_mail’ action should work for you. The tricky part is stopping CF7 from sending email, if that is your intent. I figured out how to do this. Use the ‘wpcf7_mail_components’ filter and set $components['send'] in the passed array to false before returning the entire array.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Edit Web Page’ is closed to new replies.