Home  >  Article  >  PHP Framework  >  How to do thinkphp redirect

How to do thinkphp redirect

藏色散人
藏色散人Original
2022-12-08 09:30:271624browse

thinkphp redirect setting method: 1. Open the editor sublime; 2. Create a new method cdx for redirection; 3. Position it through the redirect method; 4. In the redirect method, put the first Two parameters: 302; 5. Open the URL in the browser and access it.

How to do thinkphp redirect

The operating environment of this tutorial: Windows 7 system, ThinkPHP version 5, Dell G3 computer.

What to do with thinkphp redirection?

Set up redirection in thinkphp5:

First open the editor sublime

How to do thinkphp redirect

Then write the content of the comment.

How to do thinkphp redirect

Create a new method cdx for redirection

How to do thinkphp redirect

Position through the redirect method.

How to do thinkphp redirect

In the redirect method, we can also put the second parameter 302

How to do thinkphp redirect

The redirected address is also Can point to an external address.

How to do thinkphp redirect

Finally open the URL in the browser to access it.

How to do thinkphp redirect

Recommended study: "thinkPHP Video Tutorial"

The above is the detailed content of How to do thinkphp redirect. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn