diff options
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/functions.php b/functions.php index 8a7824b..6d3d3cc 100644 --- a/functions.php +++ b/functions.php @@ -1,29 +1,14 @@ <?php - -function echoln($content){ - if($content === true){ - $content = "true"; - } - if($content === false){ - $content = "false"; +// 是否已经登录 +function isLogin() { + session_start(); + if (isset($_SESSION["admin"]) && $_SESSION["admin"] === true) { + return true; + } else { + return false; } - echo $content; - echo "<br/>"; -} -function println($content) -{ - print_r($content); - echo "<br/>"; } -// 替换为html转义字符,否则插入sql会有问题 -function html_escape_string($str) { - $str = str_replace("'", "'", $str); // ' - $str = str_replace('"', """, $str); // " - return $str; -} - -?> - +?>
\ No newline at end of file |