Reply to Re: Simple Logic Question

Your name:

Reply:


Posted by Matt on 08/26/07 23:25

> But then how do the premium users read the non-premium articles? Of
> course if you can answer that then you've solved your original problem.
>
> Norm
>
> p.s. You need to check your users permissions prior to retrieving your
> articles. In other words, build your SELECT statement based on your
> users permissions:
>
> if ($user_is_premium)
> {
> SELECT both non-premium and premium articles here}
>
> else
> {
> SELECT non-premium articles here}
>
> ...rest of code
>
> should be a rather small change to your code.


Basically on the article index page I'll just loop through all of the
articles in the table, and test for isPremium. If a row isPremium,
I'll send the link to displaypremiumarticle.php?id=123, if not, just
to displayarticle.php?id=123.

That code would make things simpler but this page specifically
displays a single article, hence the confusion. I could just do the
above method and not show the links to non-premium users but this
means a curious user could just guess at URLs and find 'hidden'
content.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация