《PHP編程:PHP快速生成各種信息提示框的方法》要點(diǎn):
本文介紹了PHP編程:PHP快速生成各種信息提示框的方法,希望對您有用。如果有疑問,可以聯(lián)系我們。
PHP教程本文實(shí)例講述了PHP快速生成各種信息提示框的辦法.分享給大家供大家參考,具體如下:
PHP教程
function ShowMsg($msg, $gourl, $onlymsg = 0, $limittime = 0) //系統(tǒng)提示信息
{
/*
*$msg 信息提示的內(nèi)容
*$gourl 需要跳轉(zhuǎn)的網(wǎng)址
*$onlymsg 1 表示不自動(dòng)跳轉(zhuǎn) 0表示自動(dòng)跳轉(zhuǎn)
*$limittime 跳轉(zhuǎn)的時(shí)間
*/
global $dsql, $cfg_ver_lang;
if (eregi ( "^gb", $cfg_ver_lang ))
$cfg_ver_lang = 'utf-8';
$htmlhead = "<html>\r\n<head>\r\n<title>系統(tǒng)提示</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\" />\r\n";
$htmlhead .= "<base target='_self'/>\r\n</head>\r\n<body leftmargin='0' topmargin='0'>\r\n<center>\r\n<script>\r\n";
$htmlfoot = "</script>\r\n</center>\r\n</body>\r\n</html>\r\n";
if ($limittime == 0)
$litime = 5000;
else
$litime = $limittime;
if ($gourl == "-1") {
if ($limittime == 0)
$litime = 5000;
$gourl = "history.go(-1);";
}
if ($gourl == "" || $onlymsg == 1) {
$msg = "<script>alert(\"" . str_replace ( "\"", "“", $msg ) . "\");</script>";
} else {
$func = " var pgo=0;
function JumpUrl(){
if(pgo==0){ location='$gourl'; pgo=1; }
}\r\n";
$rmsg = $func;
$rmsg .= "document.write(\"<br/><div style='width:400px;padding-top:4px;height:24;font-size:10pt;border-left:1px solid #999999;border-top:1px solid #999999;border-right:1px solid #999999;background-color:#CCC;'>系統(tǒng)提示信息:</div>\");\r\n";
$rmsg .= "document.write(\"<div style='width:400px;height:100;font-size:10pt;border:1px solid #999999;background-color:#f9fcf3'><br/><br/>\");\r\n";
$rmsg .= "document.write(\"" . str_replace ( "\"", "“", $msg ) . "\");\r\n";
$rmsg .= "document.write(\"";
if ($onlymsg == 0) {
if ($gourl != ";" && $gourl != "") {
$rmsg .= "<br/><br/><a href='" . $gourl . "'>如果你的瀏覽器沒反應(yīng),請點(diǎn)擊這里...</a>";
}
$rmsg .= "<br/><br/></div>\");\r\n";
if ($gourl != ";" && $gourl != "") {
$rmsg .= "setTimeout('JumpUrl()',$litime);";
}
} else {
$rmsg .= "<br/><br/></div>\");\r\n";
}
$msg = $htmlhead . $rmsg . $htmlfoot;
}
if (isset ( $dsql ) && is_object ( $dsql ))
@$dsql->Close ();
echo $msg;
}
PHP教程更多關(guān)于PHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《PHP基本語法入門教程》、《php常用函數(shù)與技巧總結(jié)》及《php面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》
PHP教程希望本文所述對大家PHP程序設(shè)計(jì)有所贊助.
《PHP編程:PHP快速生成各種信息提示框的方法》是否對您有啟發(fā),歡迎查看更多與《PHP編程:PHP快速生成各種信息提示框的方法》相關(guān)教程,學(xué)精學(xué)透。維易PHP學(xué)院為您提供精彩教程。
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/7601.html