Help needed for Article management system

Hi Friends,

I am new in PHP/MySQL, i am developing article managemenst system for my assignment. Where in the members of the site after registering under different packages will allow to view articles. For eg we have packages like 25 artilces, 50 articles, 100 articles etc. Now if a member have subscribe for 25 articles after viewing the 25th article he will not be allow to view anymore and his a/c will be disabled. After renewal of his a/c he will be allowed to access more artilcle. Now my question is that how can i keep track of the articles viewed by the member in database and the query needed to pass in the database which will match his to no. of subscription and his current viewing so that after the member cross the limit his a/c will get disabled.

Please help me

Regards
Prateek

You will find session variables will help a great deal in this. You can use this to keep track of the user id.

Then everytime they click an article you will need run a function, in which you will need to create, that takes the session variable and updates the record.

UPDATE mytable SET hitcount = hitcount + 1 WHERE u_id = '$_SESSION[‘u_id’]

Something like the above will easily update a field by 1. One thing to keep in mind is you will only want to run your update at the end of the page of the article and you will want to run another function to check if they need to renew subscription at the top of the article page or just after they click subscription button.

Sponsor our Newsletter | Privacy Policy | Terms of Service