PHP jump function and compilation of a common operation prompt class

Source: Internet
Author: User
PHP jump function and a common operation prompt class to write PHP jump, that is, redirect the browser to the specified URL, is a very common function. This feature also has some detailed requirements, such as the number of seconds to wait for the jump, the use of JavaScript to achieve the jump, and so on. The following jump method takes into account a lot of parameters and can be used in specific projects. & Lt ;? Php *** redirects the browser to the specified URL. PHP jump function and writes a common operation prompt class.

PHP redirection, that is, redirecting a browser to a specified URL, is a common function. This feature also has some detailed requirements, such as the number of seconds to wait for the jump, the use of JavaScript to achieve the jump, and so on. The following jump method takes into account a lot of parameters and can be used in specific projects.

 
 ';} If ($ return) {return $ out;} echo $ out; exit ;}?>


Compilation of a common operation prompt class

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.

 Tips ="
 

$ String

Return (automatically returned in 4 seconds)

"; 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 );



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.