Note that there are some explanatory texts on larger screens.

plurals
  1. POhiding <li> html tag with php
    primarykey
    data
    text
    <p>I am making a user management system what i want to do is when the user is logged in he cant see (ex. sales employee) he cant see links for other departments, what I'm trying to do is simple but I don't know why its not working, my code is: </p> <pre><code>$departmentidquery = mysql_query("SELECT department_id FROM users WHERE username = '".$username."'"); $departmnetid = mysql_fetch_row ($departmentidquery); &lt;ul&gt; &lt;li&gt;&lt;a href="logout.php"&gt;Logout.&lt;/a&gt;&lt;/li&gt; &lt;li &lt;?php if ($departmnetid[0]!=1){?&gt;style="display:none"&lt;?php } ?&gt;&gt; &lt;a href="admin.php"&gt;Admin Pgae&lt;/a&gt; &lt;/li&gt; &lt;li &lt;?php if ($departmnetid[0]!=2){?&gt;style="display:none"&lt;?php } ?&gt;&gt; &lt;a href="sales.php"&gt;sales Pgae&lt;/a&gt; &lt;/li&gt; &lt;li &lt;?php if ($departmnetid[0]!=3){?&gt;style="display:none"&lt;?php } ?&gt;&gt; &lt;a href="tech.php"&gt;Tech Pgae&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>The error is:</p> <pre><code>SCREAM: Error suppression ignored for ( ! ) Notice: Undefined variable: departmnetid in C:\wamp\www\Ticket.sys\index.php on line 49 SCREAM: Error suppression ignored for ( ! ) Notice: Undefined variable: departmnetid in C:\wamp\www\Ticket.sys\index.php on line 50 SCREAM: Error suppression ignored for ( ! ) Notice: Undefined variable: departmnetid in C:\wamp\www\Ticket.sys\index.php on line 51 </code></pre> <p>I am sure from the query, I already tried the trick of <code>display:none</code> with <code>&lt;div&gt;</code> and its working, is there a better way to do that? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload