欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP快速生成各種信息提示框的方法

 更新時間:2016年02月03日 11:24:18   作者:不是JS  
這篇文章主要介紹了PHP快速生成各種信息提示框的方法,實例分析了PHP動態(tài)構(gòu)造html與JS頁面元素與調(diào)用顯示的相關(guān)技巧,需要的朋友可以參考下

本文實例講述了PHP快速生成各種信息提示框的方法。分享給大家供大家參考,具體如下:

function ShowMsg($msg, $gourl, $onlymsg = 0, $limittime = 0) //系統(tǒng)提示信息
{
/*
*$msg 信息提示的內(nèi)容
*$gourl 需要跳轉(zhuǎn)的網(wǎng)址
*$onlymsg 1 表示不自動跳轉(zhuǎn) 0表示自動跳轉(zhuǎn)
*$limittime 跳轉(zhuǎn)的時間
*/
  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 = "javascript: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 != "javascript:;" && $gourl != "") {
        $rmsg .= "<br/><br/><a href='" . $gourl . "'>如果你的瀏覽器沒反應(yīng),請點擊這里...</a>";
      }
      $rmsg .= "<br/><br/></div>\");\r\n";
      if ($gourl != "javascript:;" && $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;
}

更多關(guān)于PHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《PHP基本語法入門教程》、《php常用函數(shù)與技巧總結(jié)》及《php面向?qū)ο蟪绦蛟O(shè)計入門教程

希望本文所述對大家PHP程序設(shè)計有所幫助。

相關(guān)文章

最新評論