Because there is no msgbox, PHP programs often use JavaScript+DOM to pop up message boxes or jump to web pages. During the development of the Shuguang examination platform, in order to reuse the code, a simple function was written and saved in a file, which can be referenced when needed. Although it is a bit childish, it is economical and practical.
- /*1. Pop-up message*/
- function aler($msg)
- {
- echo "";
- }
-
- /*3. Delay for the specified number of seconds and then jump to the specified webpage*/
- function goto($tim,$goto)
- {
- echo "";
- }
-
-
- /************************
- //Application example
- aler("Thanks for browsing!");
- msge("Sorry, need to start again!");
- msge("Welcome!","http://www.sgksw.net");
- goto(5,"http://www.sgksw.net");
- ************ *****************/
Copy code
|