本文整理汇总了PHP中Tool::Html_Special方法的典型用法代码示例。如果您正苦于以下问题:PHP Tool::Html_Special方法的具体用法?PHP Tool::Html_Special怎么用?PHP Tool::Html_Special使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::Html_Special方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Html_Special
static function Html_Special($date)
{
if (is_array($date)) {
foreach ($date as $key => $value) {
$string[Tool::Html_Special($key)] = Tool::Html_Special($value);
}
return $string;
} elseif (is_object($date)) {
foreach ($date as $key => $value) {
$string->{$key} = Tool::Html_Special($value);
}
return $string;
} else {
return htmlspecialchars($date);
}
}
示例2: updateManage
public function updateManage()
{
$this->username = Tool::Html_Special($_POST['admin_user']);
$this->pass = sha1($_POST['admin_pass']);
$this->level = $_POST['level'];
$this->id = $_GET['id'];
if (empty($this->pass)) {
//如果密码为空,那么不修改密码
$sql = "update\r\n\t\t\t\t\t\t\t\t\t\tmanage\r\n\t\t\t\t\t\t\t\tset\r\n\t\t\t\t\t\t\t\t\t\tusername='{$this->username}',\r\n\t\t\t\t\t\t\t\t\t\tlevel='{$this->level}'\r\n\t\t\t\t\t\t\twhere\r\n\t\t\t\t\t\t\t\t\t\tid='{$_POST['id']}';";
} else {
//密码不为空
$sql = "update\r\n\t\t\t\t\t\t\t\t\t\t\t\tmanage \r\n\t\t\t\t\t\t\t\t\t\tset\r\n\t\t\t\t\t\t\t\t\t\t\t\t username='{$this->username}',\r\n\t\t\t\t\t\t\t\t\t\t\t\tpassword='{$this->pass}',\r\n\t\t\t\t\t\t\t\t\t\t\t\tlevel='{$this->level}'\r\n\t\t\t\t\t\t\t\t\t where \r\n\t\t\t\t\t\t\t\t\t\t\t\tid='{$_POST['id']}';";
}
$affected_rows = parent::add_up_de($sql);
if ($affected_rows == 1) {
Tool::alertLocation('恭喜你,修改成功', $_POST['prev_url']);
} else {
Tool::alertBack('很遗憾,修改失败');
}
}
示例3: Add_Nav
public function Add_Nav()
{
$this->sort = $this->Next_Nav_Id();
$this->name = Tool::Html_Gpc(Tool::Html_Special($_POST['nav_name']));
$this->info = Tool::Html_Special($_POST['nav_info']);
$this->parid = $_POST['parid'];
$sql = "insert into \r\n\t\t\t\t\t\t\t\t\t\t\tnav \r\n\t\t\t\t\t\t\t\t\t\t\t(name,\r\n\t\t\t\t\t\t\t\t\t\t\tinfo,\r\n\t\t\t\t\t\t\t\t\t\t\tparid,\r\n\t\t\t\t\t\t\t\t\t\t\tsort) \r\n\t\t\t\t\t\t\t\tvalues (\r\n\t\t\t\t\t\t\t\t\t\t\t'{$this->name}',\r\n\t\t\t\t\t\t\t\t\t\t\t'{$this->info}',\r\n\t\t\t\t\t\t\t\t\t\t\t'{$this->parid}',\r\n\t\t\t\t\t\t\t\t\t\t\t'{$this->sort}')";
$affected_rows = parent::add_up_de($sql);
if ($affected_rows == 1) {
Tool::alertLocation('恭喜你,导航新增成功', 'nav.php?action=show');
} else {
Tool::alertBack('很遗憾,导航新增失败');
}
}