Now I am editing on the site page, if I entered the admin panel with my login and password (I use the session) on the site page for each article a block with buttons appears at the top (edit, delete, activate / deactivate and so on).
Code example:
<?php if($_SESSION['admin']): ?> <div class="but_header"> <a href="../admin/edit.php?id=<?php echo $id; ?>"><div class ="edit">Редактировать</div></a> <a href="../admin/delete.php?id=<?php echo $id; ?>"><div class ="delete">Удалить</div></a> </div> <? endif ; ?> The question is: am I doing the right thing, or is there some better way to pull out such a block with buttons?
Is this a safe way or not? Can do some additional verification, password or something else ...