[英]How to show hidden div in php
I have lecturer
div. 我有lecturer
div。 I hidden this div. 我隐藏了这个div。 After that if($user->hasPermission('admin'))
this function is true i want to show lecturer
div.I will put stars ****
like this. 在那之后if($user->hasPermission('admin'))
这个函数是真的,我想显示lecturer
div。我会像这样放星星****
。 I want show div for that place. 我想要在那个地方显示div。
<?php
require_once 'core/init.php';
$user = new User();
if($user->isLoggedIn()) {
?>
<li><a href="logout.php">Log Out</a></li>
<div class="lecturer" id="lecturer" style="display: none;">
<label for="studentID">Student ID</label>
</div>
<?php
if($user->hasPermission('admin')){
echo '<p>You are the admin</p>';
********I want to show lecturer dive here*************
}
}else {
echo '<p>You need to <a href="login.php">login</a> or <a href="register.php">register</a>';
}
Try: 尝试:
<?php
require_once 'core/init.php';
$user = new User();
if($user->isLoggedIn()) {
?>
<li><a href="logout.php">Log Out</a></li>
<div class="lecturer" id="lecturer" style="display: none;">
<label for="studentID">Student ID</label>
</div>
<?php
if($user->hasPermission('admin')){
echo '<p>You are the admin</p>';
echo '<div>Lecturer</div>';
}
}else {
echo '<p>You need to <a href="login.php">login</a> or <a href="register.php">register</a>';
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.