There is a condition: if the admin, then the mail link is visible in the account, if not the admin, then it is not visible. How with this condition to organize it?

if (has_access($session_user_id, 1) === true) 
  • And now in Russian and in more detail. - Artem
  • What did I write in Arabic? there is an admin panel, there is a mail.php file; you need to plug it in there, so that not by url you can go through it, there are regular users, how to make it so that mail is only in the admin account - LLIAKAJI
  • Just for information: protection at the URL level is not the best idea. PS: no one will give you a sensible answer, because no one knows how your project works. if html is displayed stupidly then: if (has_access ($ session_user_id, 1) === true) {echo '<a href="mail.php?..."> mail </a>'; } - Alex Kapustin
  • 2
    what is the has_access where the $session_user_id variable comes from, who returns what and so on. And it looks like: There is a car, the drivers are different, how to find out from the wheel radius how much it can drive on a liter of gasoline. - Artem
  • the whole question was solved, it was necessary to enter this way) if (has_access ($ session_user_id, 1) === true) {echo '<a href="mail.php?..."> mail </a>'; } - LLIAKAJI

1 answer 1

 function has_access($session_user_id,$page_id){ $res = mysql_query('select `user_access` from `access` where `user_id`='.$session_user_id.' and `page_id`='.$page_id); $row = mysql_fetch_object($res); return $row->user_access; } 

I did not understand the question.

  • it was necessary that in the admin mail could be seen and no other users, it is rather html than php but already organized everything! - LLIAKAJI