Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    dgf
    dgf is offline
    New to the CF scene
    Join Date
    Dec 2012
    Location
    Argentina
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Contact Form once per day

    Hi! I have been asked to create a contact form for a contest that each person can only send it once per 24hs. What would be the right method to do this without using db? I dont have much skills in php or java, and none in db, so Im asking for your help please!

    The info that I will use to know which person filled the form is an input called DNI (which is the personal identification number) so when validating the form, it sholud look for that number (i dont know were and how hehe) and compare dates (or hours) to allow or deny sending the form.


    sry my english if its not right

    thks!!

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,441
    Thanks
    62
    Thanked 537 Times in 524 Posts
    Quote Originally Posted by dgf View Post
    What would be the right method to do this without using db?

    I dont have much skills in php or java, and none in db, so Im asking for your help please!

    so when validating the form, it sholud look for that number (i dont know were and how hehe)
    Without a database, in short you can't do it. You need to be able to record things such as submission times etc to a database so that you can check them, run time difference calculations etc.

    Sorry to be blunt about this but if you're not able to use a database, not prepared to try or learn then you shouldn't be taking on this job if you're simply not skilled enough to do so.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    dgf
    dgf is offline
    New to the CF scene
    Join Date
    Dec 2012
    Location
    Argentina
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx for answering!
    Maybe saving the data in a xml or txt file and then reading the information from there?

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,441
    Thanks
    62
    Thanked 537 Times in 524 Posts
    You could do that but then supposing you need to cross reference data, count how many users submitted a form within a 24 hour period etc? You'd need to open up possibly thousands of files (consuming system memory) and then loop through every single one, store things in an array (using more memory) etc etc.

    With a database you just run a query, the database does it all in a memory efficient way and returns only the data you need and in a fraction of the time.

    I speak from personal experience. I avoided databases like they were the plague - for years on end. I used text files for several projects and all you end up doing is chasing your own tail around, debugging why things don't work, why did that bit of data get wiped etc. It really is far easier to use a database and it really isn't as hard as you think either.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #5
    Regular Coder
    Join Date
    Jul 2012
    Location
    London
    Posts
    473
    Thanks
    4
    Thanked 86 Times in 86 Posts
    I don't think it's possible without a database, you might be able to use cron jobs.

    You could save the data to a xml file, but you would need some sort of script to record a unqiue id and recall that id..
    (their ip address

    Take a look @ http://fabrikar.com/forums/showthread.php?t=12168


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •