What I am trying to do is if an individual has a user_type of 'admin' they would would be able to see two links within a HTML table called 'Edit' and another link called 'Delete' under the 'Actions' column/header and if they have a user_type of 'user' I want to hide or conceal the entire 'Actions' column/header and its contents. Below is the code which was used:
<?php
if ($_SESSION['user_type'] == admin) {
echo '<a href = "edit.php?pid=' . $row['Imageid'] . '">Edit</a>
|
<a href = "delete.php?pid=' . $row['Imageid'] . '">Delete </a>';
}
?>
However the specific problem I am experiencing is when the code is executed I am getting the following two errors:
'Notice: Undefined index: user_type in C:\wamp64\www\project\usermain.php on line 74'
and
'Notice: Use of undefined constant admin - assumed 'admin' in C:\wamp64\www\project\usermain.php on line 74'
I tried what was said here: Reference - What does this error mean in PHP? but I was unsuccessful. Can you please assist?