Jump to content

Hey, anyone have a clue here...


GetReady

Recommended Posts

Hey, basically this code below SHOULD hide the admin panel from non admins (any level other than 1) active is the level... Now the code is somewhat working as its hiding the code... but from the admins as well is there an error in this particular code im missing or do i need to dig deeper, any help will be appreciated, Thanks.

 

<?
if ($usT->active==1) 
{
?>

<form method="POST">
<input type="radio" name="all"> Reset Round<BR><BR>
<input type="submit" name="reset" value="Reset Round!">
</form>
<? }else{ echo "You are not allowed to view this page!"; } ?>

Link to comment
https://forums.phpfreaks.com/topic/199757-hey-anyone-have-a-clue-here/
Share on other sites

Your if statement may be trying to do a string comparison, try putting ' around the 1 like below

 

<?php
if ($usT->active=='1') 
{
?>

<form method="POST">
<input type="radio" name="all"> Reset Round<BR><BR>
<input type="submit" name="reset" value="Reset Round!">
</form>
<?php }else{ echo 'You are not allowed to view this page!'; } ?>

 

I'd also try and use long php tags (<?php ?>) been struck down many a time by that!

Also just another little tip, using double quotation marks will tell PHP to look for a variable within that string, if you don't have one thats a millisecond you just lost for nothing :P

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.