WPAdverts - How to limit form submission 10 per month

by gezuka   Last Updated June 12, 2019 23:08 PM

I currently use wpadverts plugin and wants to limit the submission to 10 submit / month.

How can I do that?

I think I need to make a new row like "form_submissions" in "wp_usermeta" and store every time when the user submitted the form and make a cron task to delete the row value after a month.

And I need to query the row value on the form submit page like this:

$result = mysqli_query($connect, "SELECT COUNT(*) AS `form_submission` FROM wp_usermeta WHERE user_id = $user_id");

    $row = mysqli_fetch_assoc($result);

    if($row['form_submission'] > 10) {
        // can't submit the form because you already have 10 post
    } else {
        // you can submit the form
    }

Or I'm totally lost? Sorry for my bad english.

Tags : forms limit


Related Questions


Updated April 07, 2015 18:03 PM

Updated November 13, 2018 22:08 PM

Updated April 09, 2018 23:08 PM

Updated October 02, 2018 10:08 AM

Updated March 29, 2015 06:02 AM