This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

IP address or cookie - return visitors


  1. visibilityone
    Member

    Hi, I know there is a way to Limit One Entry Per IP but I am looking for something different.

    My clients opening (homepage) of their site requires that they fill in the machform before they can view the site. Right now if the person fills it out and then returns tomorrow or next week, they should not have to fill out the form again because either a cookie or IP address should determine whether they have filled out the form in the past. I still want to make sure that each visit to the site is captured in the entries and export though.

    Is there a way to do this now with some custom code on either machform or on our site?

    Please let me know asap as this is urgent.

    Thanks for all the help! Great Software!!!

    Posted 9 years ago #
  2. visibilityone
    Member

    Is it possible to edit this code to make this work?

    Please look at includes/post-functions.php file and search for these code around line 1710 :

    $query = "select count(id) total_ip from ".MF_TABLE_PREFIX."form_{$form_id} where ip_address=? and status=1";

    then I can change the SQL code to be like this

    $query = "select count(id) total_ip from ".MF_TABLE_PREFIX."form_{$form_id} where ip_address=? and status=1 and date(date_created) = curdate();";

    But I would also somehow need to look at the cookies to still capture them into the database, but also redirect them to a different homepage that doesnt have the machform overlayed on it.

    Please be detailed in your answer as I am not a programmer.

    Thanks!

    Posted 9 years ago #
  3. yuniar

    I'm afraid that won't be quite simple change and I believe this shouldn't be done through machform.

    Instead, you should use the custom code within your homepage. Your homepage need to set the cookie and check for any previous cookie. If cookie found, don't display the form. We won't be able to provide you with the coding for this though. Sorry.


    MachForm Founder

    Posted 9 years ago #
  4. visibilityone
    Member

    OK so I assume I can implement something similiar to this article here:

    http://css-tricks.com/redirecting-to-a-splash-page-but-only-once-with-cookies/

    but the issue is what do I need to do to make sure that your reporting still logs that person as a new entry for that day? I want to make sure I capture in the export every time they visited.

    Thanks!

    Posted 9 years ago #

RSS feed for this topic

Reply