You are here: Simple Logic Question « PHP Programming Language « IT news, forums, messages
Simple Logic Question

Posted by Matt on 08/26/07 21:01

Hey everyone,

This is a pretty silly one, I just can't get my head around it.

I have a table of artices, with a row "isPremium", meaning it's
content available only to paid users. In my corresponding user table I
have a row "user_group" with various levels signifying access rights.

In my file displayarticle.php I'm trying to process this. What I want
is for the system to check the article ID, if it's premium, check the
user's credentials (and if they're not okay, print some kind of
error), and if it's not premium, just display it as normal.

My efforts to do this have given errors due to my nested if statements
and I can't seem to think of a solution that doesn't involve my (200
line) display article code being repeated for both possible outcomes
(eg, isPremium = true or false). Can anyone point out the blindingly
obvious solution I'm missing?

Matt

 

Navigation:

[Reply to this 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

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