teamfox20 wrote:oh sorry...lol...its done with sessions
No problem. Well, yes then, it's a matter of simple if statement like you mentioned. To illustrate...
<?php
$user = mysql_real_escape_string($_POST['user']);
$pass = mysql_real_escape_string($_POST['pass']);
$sql = "SELECT name,role,etc FROM user WHERE username='$user' AND password='$pass'";
/* query database decide if they are autheticated based on results. If they are... */
$_SESSION['ROLE'] = $row['role'];
/* in your accout page now you can simply do ... */
if ( $_SESSION['ROLE'] == 'paid' )
{
//show one thing.
echo '<br>1';
echo '<br>2';
echo '<br>3';
echo '<br>4';
echo '<br>5';
}
else
{
//show another
echo '<br>6';
echo '<br>7';
echo '<br>8';
echo '<br>9';
echo '<br>0';
}
/* or if you have multiple roles in the future ... */
switch ($_SESSION['ROLE']) {
case "paid":
//show one thing.
echo '<br>1';
echo '<br>2';
echo '<br>3';
echo '<br>4';
echo '<br>5';
break;
/* and so on ... */
default:
break;
}
?>