Hi,
Can any body provide me some code reference regarding,how to limit execution of a function to a registered user everyday for n number of times.Like user can only send 20 mails everday.so allowing execution of mail function for only 20 time everday and resetting the counter the next day and showing error fot the same if the limit is reached.

Store the limit and a last changed date in a table. Before updating a value, see when it was changed last, to determine if it should be reset.

Store the limit and a last changed date in a table. Before updating a value, see when it was changed last, to determine if it should be reset.

hi thanks priteas, i wana know if i can user crons to reset the counter like, suppose around 12 am the reset function should be deactivated..i m still confused..

Yes. Make a php script to reset all values, and execute it through your crontab.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.