首页
导航
博客
电子书
算法
众创
代码
随贴
关于我们
您好,欢迎来到码863代码分享网! 请
[登录]
/
[注册]
搜 索
显示一个提示信息页面 独立函数
编辑
代码正文
双击正文可选择全部
1[代码][php]
尝试一下
/** * 显示一个提示信息 独立函数 * * @access public * @param string $content * @param array links 跳转链接 可选填 array('首页'=>'index.php') * @param string $type 消息類型, 0消息,1錯誤,2詢問 * @param string $auto_redirect 是否自动跳转 * @return void * $Id: index.php 11:26 2015/5/10 @version 0.0.2 */ function show_message($content, $links = array(), $type =0, $auto_redirect = true){ $charset='UTF-8';//$cfg $msg['content'] = $content; if (count($links) == 0){ $msg['url_info']['返回上一页'] = 'javascript:history.back()'; $msg['back_url'] = 'javascript:history.back()'; }else{ $i=0; foreach($links as $text =>$url){ $msg['url_info'][$text] = $url; $i++==0 ? $msg['back_url'] = $url :''; } } $msg['type'] = $type; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>" /> <title>检测消息</title> <?php if($auto_redirect){?> <meta id="stop" http-equiv="refresh" content="2;URL=<?php echo $msg['back_url']; ?>" /> <?php } ?> <style> body{margin:0;} a { text-decoration: none; color: #069; } a:hover { color: #F60; } .clear { clear: both; } #message { text-align: center; width: 800px; font-family: "微软雅黑", Verdana, sans-serif, "宋体"; margin-right: auto; margin-left: auto; margin-top: 80px; line-height: 1.8; font-weight: bold; } .wait { color: #096; } .error { color: #C00; font-size: 24px; } #message_txt { width: 800px; } #public_service { margin-top: 150px; } #error_head { height: 70px; background-color: #09C; } img { margin-top: 10px; margin-bottom: 10px; } #error_head .title { line-height: 70px; height: 70px; width: 800px; margin-right: auto; margin-left: auto; } #error_head .title .err { font-family: "微软雅黑", Verdana, sans-serif, "宋体"; font-weight: bold; color: #FFF; font-size: 36px; } #error_head .title .home { margin-left: 30px; font-family: "微软雅黑", Verdana, sans-serif, "宋体"; font-size: 14px; } #error_head .title .home a { color: #000; } #error_head .title .home a:hover { color: #FFF; } #message_txt .tip { margin-top: 20px; } </style> </head> <body><div id="error_head"><div class="title"><span class="err">检测消息</span><span class="home"></span></div></div><div id="message"><div id="message_txt"><div class="msg"><span class="error"><?php echo $msg['content']; ?></span></div> <?php if($msg['url_info']){?> <!-- div class="tip">如果您的浏览器没有下载请点击 <a href="<?php echo $msg['back_url']; ?>">这里</a></div --> <div class="tip"> <?php if($msg['url_info']){?> <?php foreach( $msg['url_info'] as $info=>$url ){?> <p style="line-height:20px;"><a href="<?php echo $url; ?>">《 <?php echo $info; ?></a></p> <?php } ?> <?php } ?> </div> <?php } ?> </div><div class="clear"></div></div></body></html> <?php exit; }
文明上网理性发言,请遵守新闻评论服务协议
0 条评论
发布评论
全部评论
最新
/
最热
暂无评论
加载更多
CopyRight 2002~2023 精通2100网 联系邮箱:qqtxt@163.com
版权所有:精通2100网
湘ICP备2023018646号-1
MYSQl共执行 3 个查询,用时 0.0018260478973389 秒,PHP脚本用时 0.004039 秒,占用内存 0.509 MB,Gzip 已启用