GithubHelp home page GithubHelp logo

Die after redirect about klein.php HOT 2 CLOSED

klein avatar klein commented on June 27, 2024
Die after redirect

from klein.php.

Comments (2)

Rican7 avatar Rican7 commented on June 27, 2024

Yes. A redirect() call is simply a way to easily set the Response's code and "Location" header. This is much like Ruby's "Rack" middleware, and most other implementations of low-level HTTP handling in frameworks.

The redirect() method also conveniently locks the Response, though, so no further modifications will easily be made to it without explicitly unlocking it first.

If you'd like a more immediate effect, then you could run send() right after to write the headers right then. However, the code following those statements will still run.

It may seem counter-intuitive if you think of the redirect() method as a "browser command" or some other black magic, but all its really doing is sending a header, which PHP has to send to the browser/HTTP client.

Fore more information: http://stackoverflow.com/a/2747803/852382

from klein.php.

 avatar commented on June 27, 2024

Thanks for the explanation. :-)

from klein.php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.