PHP implements General alert functions, and php universal alert functions. PHP: the method for implementing the general alert function. the example in this article describes how php implements the general alert function. Share it with you for your reference. Specifically: functions: methods for implementing general alert functions using PHP, and general alert functions using php
This example describes how to implement a common alert function in PHP. Share it with you for your reference. The details are as follows:
Function: common prompt
Parameter: prompt message, type or website, window name or function name, delay in milliseconds
Alert ("", "function", "close2", 300 );
The code is as follows:
Function Alert ($ Str, $ Typ = "back", $ TopWindow = "", $ Tim = 100) {echo "script". chr (10); if (! Empty ($ Str) {echo "alert (\" Warning :\\ n \ n {$ Str} \ n \");". chr (10);} echo "function _ r_r _ () {"; $ WinName = (! Empty ($ TopWindow ))? "Top": "self"; switch (StrToLower ($ Typ) {case "#": break; case "back": echo $ WinName. ". history. go (-1 );". chr (10); break; case "reload": echo $ WinName. ". window. location. reload ();". chr (10); break; case "close": echo "window. opener = null; window. close ();". chr (10); break; case "function": echo "var _ T = new function ('return {$ TopWindow} ') (); _ T ();". chr (10); break; // Die (); Default: if ($ Typ! = "") {// Echo "window. {$ WinName }. location. href = '{$ Typ}'; "; echo" window. {$ WinName }. location = ('{$ Typ}'); ";}} echo "}". chr (10); // to prevent Firefox from skipping the setTimeout echo line "if (setTimeout (\" _ r_r _()\",". $ Tim. ") = 2) {_ r_r _ () ;}"; if ($ Tim = 100) {echo" _ r_r _();". chr (10);} else {echo "setTimeout (\" _ r_r _()\",". $ Tim. ");". chr (10);} echo "script". chr (10); Exit ();}
I hope this article will help you with php programming.
Examples in this article describes how PHP implements General alert functions. Share it with you for your reference. The details are as follows: Function: General mention...