Home > Backend Development > PHP Tutorial > php验证显示内容

php验证显示内容

WBOY
Release: 2016-06-23 14:16:46
Original
1051 people have browsed it

验证会员身份

<?php                                if($cuserLogin->getUserType()==10) {                                    echo "总管理员";                            } else if($cuserLogin->getUserType()==5) {                                echo "频道总编";                            }                        ?>
Copy after login


查询并显示内容

<?php         $dsql->SetQuery("SELECT * FROM `#@__arcatt` ORDER BY sortid ASC");         $dsql->Execute();         while($trow = $dsql->GetObject())         {         	if($trow->att=='j')         	{         		$jumpclick = " onclick='ShowUrlTr()'";         	}         	else         	{         		$jumpclick = '';         	}         	if(preg_match("#".$trow->att."#", $arcRow['flag']))         	{         		echo "<input class='np' type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}' {$jumpclick} checked='checked' />{$trow->attname}[{$trow->att}]";         	}         	else         	{         		echo "<input class='np' type='checkbox' name='flags[]' id='flags{$trow->att}' value='{$trow->att}'{$jumpclick} />{$trow->attname}[{$trow->att}]";         	}         }          ?>
Copy after login



描述:我想先验证会员身份后在执行查询代码,例如:会员身份为"总管理员"则执行查询代码,如果会员身份为"频道总编"则什么都不显示.


回复讨论(解决方案)

直接if($cuserLogin->getUserType()==10){}里边写查询的代码不就好了    这样如果不是就不执行了

直接if($cuserLogin->getUserType()==10){}里边写查询的代码不就好了    这样如果不是就不执行了
非常感谢

直接if($cuserLogin->getUserType()==10){}里边写查询的代码不就好了    这样如果不是就不执行了
一眼来点分!


直接if($cuserLogin->getUserType()==10){}里边写查询的代码不就好了    这样如果不是就不执行了
一眼来点分!

抓住基友一只!!!

快去回复我的帖子!

http://bbs.csdn.net/topics/390524632
http://bbs.csdn.net/topics/390524497
http://bbs.csdn.net/topics/390521927
http://bbs.csdn.net/topics/390523291

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template