|
Posted by Norman Peelman on 08/28/07 04:31
Matt wrote:
> On Aug 27, 1:45 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>
>> IF they aren't authorized, they won't get the article, even if they
>> guess the URL.
>
> This is the part I'm having trouble with. Norman's method will work
> fine to print a list of links to articles depending on user access
> rights, but my issue is for displaying a specific article. I just
> can't figure out an efficient way to test a) if the article IS premium
> and b) if the user is premium without repeating my 'output article'
> code.
>
Right, so a non-premium user will not have links to premium articles
and premium users will have links to everything which is just what you
wanted. You need to use sessions (see below) in both your index script
and your article script to keep track of the users status.
> I can't build my SELECT statement based on privileges because I have
> to make the SELECT in the first place to establish whether or not the
> article is premium content or not!
>
So really what you need to do is keep track of a users access rights
when they login. This way what Jerry and I said, put together gives you
what you're after. Use sessions to store the users credentials at login
so that you can create your queries properly.
Norm
[Back to original message]
|