When designing some systems, users are often prompted for the operation. This kind of prompt is very important, and friendly prompt can improve the user's sense of the system. There are a lot of design tips. Below is a simple solution for me.
Operation prompt class: tips_class.php
<? Phpclass Tips {private $ tips; static private $ _ instance; private function _ construct ($ string, $ url) {$ this-> tips = "<meta http-equiv = refresh content = 4; url = $ url> <div style = 'border: 1px solid # B4D8F4; width: 320px; height: 120px; margin: 0 auto; font-size: 12px; '> <div style = 'background-color: # CDE6F9; height: 20px; '> </div> <div align = 'center' style = 'font-size: 14px; font-weight: bold; margin: 20px 0 20px 0;'> $ stri Ng </div> <div align = 'center'> <a href = '$ url'> return </a> (automatically returned in 4 seconds) </div> "; return $ this-> tips;} public function _ toString () {return $ this-> tips ;} private function _ clone () {} public static function get_tips ($ string, $ url) {if (FALSE = (self ::$ _ instance instanceof self) {self:: $ _ instance = new self ($ string, $ url);} return self: $ _ instance ;}}?>
This type of function is very simple, that is, jump to a link after 4 seconds, or click to jump to that link.
The _ toString () function is very important. It can implement the string output of class objects.
How to use this class?
Include_once (". /tips_class.php "); $ hit =" error: the two passwords are inconsistent "; $ jump = ".. /login. php "; echo $ tips = Tips: get_tips ($ hit, $ jump );