Dear God, ask for a PHP website problem! A forum need to automatically give users a random bonus points each day, how should be solved?
The company operates a forum that needs to add a feature
New registered users randomly receive 1-10 points a day for one consecutive months
Is the user is not the line does not login will be presented
Then the user table for example more than three fields total gift points yesterday points today points
And then beyond one months is the 31st day no longer give more than this time the user will be logged in the location of the bonus points would prompt "You have left the internship no longer bonus points"
This is what the boss asked me to do a few days ago gave me a week of time, I have been two days, there is no idea.
Alas, small companies have no way, just me a PHP.
Besides being able to make it, it's more efficient.
Is there any solution to the great God's ideas and methods grateful!
------to solve the idea----------------------
Use a timed task to run a PHP script with your points every day for a fixed time.
------to solve the idea----------------------
There are 2 types of solutions
1 is a daily manual or Linux scheduled tasks, the full registration time within 1 months of the user to add a random points, and then the day to write down, prevent duplicate brush, the new registered users to add their own
2 is each time the user logs on to detect the last time, a few days to fill a few days, it looks like every day in the
------to solve the idea----------------------
To determine if a user can add points, you need to have a baseline: registration date
You have today points
Then another condition for determining whether you can add points is: today's point = 0
It is not important as to when and how the add-on operation is carried out
As long as the bonus points are correct, there will be no repetition or omission of bonus points.
If your site is too popular, no one will patronize you for a few days (you may need to add a previous add-on date)
Then how to add points is useless.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.