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

php验证显示内容

WBOY
WBOYOriginal
2016-06-23 14:16:461040browse

验证会员身份

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


查询并显示内容

<?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}]";         	}         }          ?>



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


回复讨论(解决方案)

直接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

Statement:
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