PHP pop-up prompt box and jump to the new page to redirect to the new page _ PHP Tutorial

Source: Internet
Author: User
In the PHP pop-up box, jump to the new page and redirect to the new page. This article describes how to use PHP to pop up a prompt box and jump to a new page, that is, what you think is redirection. for the following example, you can refer to the next two days to write a demo, we need to use this article to introduce you to the PHP pop-up prompt box and jump to the new page, that is, what you think is redirection. the following example can be used as a reference.

To write a demo in the past two days, you need to use the prompt and jump. the main page does not have high requirements and you don't think it is necessary to use AJAX, JS, etc. so I studied how to prompt and jump in PHP. First, the following code is used: echo "script alert ('sucess '); parent. location. href = '/user/index'; script "; alert contains the prompt message, and href is the page to jump to after the prompt. Later I remembered that there was a redirect () redirection method in the TP framework, so I went and looked at it. However, TP does not bring a pop-up window, so I changed it myself: the code is as follows: echo "script" alert ('No loginid'); script "; echo" "; $ Url is the page to jump to. at the same time, this can also control the jump time. The value 0 after content indicates that the page will jump after 0 seconds. Here, Mo Li provides two direct jump methods: the code is as follows: header ("Location :". PSYS_BASE_URL. "user/index"); and the code is as follows: header ("refresh: {$ time}; url = {$ url}"); the two methods do not prompt, jump directly. The following is recommended. Finally, there is another problem. after the jump code is followed by a return, because the following statement will be executed.

To write a demo in the past two days, you need to use...

Related Article

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.