PHP Code not working

Status
Not open for further replies.

iRawrHotel

Member
Mar 4, 2012
41
0
Hello,
I have this code:
Code:
<?PHP
$rank = {rank};
if($rank="15") {echo "<li><a href='delnews'>Delete News</a></li>";} ?>

But it just doesn't load the page? can anyone tell me what the problem is and supply me with the correct code.
 

Zippy

Member
Aug 5, 2010
92
28
$rank = {rank} is the problem. {rank} is for use in the templates, right? You need to replace {rank} with whatever {rank} is assigned to.
 

Zippy

Member
Aug 5, 2010
92
28
You don't understand. {rank} can only be used in a template file. It means nothing to the PHP. That is why it is causing an error.

Is the PHP in the template file?!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Is this RevCMS?

PHP:
<?PHP
if($_SESSION['user']['rank'] == 15) { echo "<li><a href='delnews'>Delete News</a></li>"; } ?>
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Thread closed.

What is saying is corrected, $_SESSION['user']['rank'] is assigned to rank} in the template class.

See her:
PHP:
$this->setParams('rank', $users->getInfo($_SESSION['user']['id'], 'rank'));

(Well, the useres actual rank which is then set to the session on login).

Thanks.
 
Status
Not open for further replies.

Users who are viewing this thread

Top