CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   Contact Form once per day (http://www.codingforums.com/showthread.php?t=285005)

dgf 12-29-2012 06:16 PM

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!!

tangoforce 12-29-2012 07:26 PM

Quote:

Originally Posted by dgf (Post 1302929)
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.

dgf 12-29-2012 09:06 PM

thx for answering!
Maybe saving the data in a xml or txt file and then reading the information from there?

tangoforce 12-29-2012 09:17 PM

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.

tempz 12-29-2012 10:26 PM

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


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.