Thank you for your advice on a php website! What should I do if a forum needs to be automatically and randomly presented to users every day?

Source: Internet
Author: User
Thank you for your advice on a php website! What should I do if a forum needs to be automatically and randomly presented to users every day? The company operates a forum and needs to add a function.
Newly registered users receive 1-10 points each day for one consecutive month.
That is, if the user is offline and does not log in, the user will be given away.

In the user table, for example, three more fields, the total points are given yesterday's points.

After one month, that is, 31st days, the user will no longer be given the points given when the user logs on again. The system will prompt "you have left the internship and no points will be given"

This is what my boss asked me a few days ago to give me a week. I have no idea if I have been busy for two days.
Alas, I can't help a small company. I just made php.
In addition to being able to do it, the efficiency is also high.
Do you have any solutions and methods? thank you!







Reply to discussion (solution)

Use scheduled tasks to run the php script that gives you points at a fixed time every day.

Same as 2 #. execute a script regularly every day.

1 #... Concept

There are 2 solutions
1 is to manually run the task or schedule the task in linux every day. users who have registered all the tasks for less than one month are randomly added with one point, and the time of the day is recorded to prevent repeated clicks, add a newly registered user to yourself
2. each time a user logs on to the system, the last minute is detected. The difference is a few days, and it looks like every day

Oh, it seems that you can only use the php timer in this case.

To determine whether a user can add points, you need a benchmark: Registration date

You have today's points
Another condition for determining whether points can be added is: Today's points = 0

It is not important to determine when to add points.
If the bonus points are correct, no extra points or missing points will be repeated.

If your website is too popular, no one will patronize it for many days (you may need to add a date for the last bonus points)
So how to add points does not help

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.