[php]代码库
function alert($word,$type=NULL,$src=NULL)
{
print("<META http-equiv='content-type' content='text/html; charset=utf-8'>");
$alert = "<script language='javascript'>alert('".$word."');";
switch($type)
{
case "back":
$alert .= "history.back();</script>";
die($alert);
break;
case "selfclose":
$alert .= "self.close();</script>";
die($alert);
break;
case "close":
$alert .= "close();</script>";
die($alert);
break;
case "exit":
$alert .= "</script>";
die($alert);
break;
default:
if($src==NULL)
{
$alert .= "</script>";
print($alert);
}else{
$alert .= "location.href = '".$src."';</script>";
die($alert);
}
break;
}
}