Store and Encrypt Contact Form 7 Submissions in Database? [closed]

As @kero said, use a CF7 hook. I’d use the wpcf7_before_send_mail hook. Grab data from the CF7 form object’s fields, and use those values to store data. I wrote a post to myself on how to get data from the CF7 form object here: http://securitydawg.com/changing-contact-form-7-with-the-wpcf7_before_send_mail-hook/ . You could use that to get started, just insert … Read more

How to verify this checkbox is checked?

<?php echo “<input type=”checkbox” name=”automatic” value=”1″ “.checked(1, get_option(‘automatic’)).” />”; if (get_option(‘automatic’) === ‘1’) { require_once ‘myfile.php’; } ?>

One comment per user per post

Simply add the post_id parameter to the get_comments arguments array something like: global $current_user,$post; $args = array(‘user_id’ => $current_user->ID,’post_id’ => $post->ID); $usercomment = get_comments($args); if(count($usercomment) >= 1){ echo ‘disabled’; } else { comment_form(); }

Using shortcodes to parse POST request (containing the data from a front-end form)

Alway send submissions to the page the form is displayed. In your shortcode callback you can then display proper error or success messages. Sample: add_shortcode( ‘classifiedsform’, ‘classifiedsform_callback’ ); function classifiedsform_callback() { if ( ‘POST’ !== $_SERVER[‘REQUEST_METHOD’] or ! isset ( $_POST[‘classifieds’] ) ) { return classifieds_input_form(); } // process input show errors or success message … Read more

Confused on AJAX submit form through page template

<form action=”<?php echo get_template_directory_uri() . “/validation.php”; ?>” id=”contactForm”> 😱 So I’ll outline the basic fundamentals, so you have a framework to move forwards with Fixing Admin AJAX So I’ll cover this very briefly as it’s not the crux of my answer, but would be useful: Add a hidden input field named action rather than adding … Read more

Checkbox won’t check when label is clicked

Okay, so in case this is of use to anyone else. The original checkbox hack tut that I was following came from here. I’ve got around the issue that I was having in WordPress by wrapping my checkboxes in the labels like <label><input id=”fieldjtdktry-0″ name=”cm-fo-jtdktry” value=”4469820″ type=”checkbox” /><span></span>Learn</label> and then just tweaking the CSS selector … Read more

$_POST empty on submit (same code, same form submits normally on local server)

The best way to deal with Form Posts in WordPress is to use a special endpoint, /wp-admin/admin-post.php. POST data can be messed up, both by the WP Query call, and by any redirects that happen. So you set up your form with this action: <form action=”<?= admin_url(‘admin-post.php’) ?>” method=”post”> <input type=”hidden” name=”action” value=”special_action”> <?php wp_nonce_field(‘special_action_nonce’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)