Re: header() not working with a http_response_code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/05/2020 12:01, Jānis Elmeris wrote:
Can you give an example `header` call that is not working for you?

https://github.com/bitweaver/kernel/blob/f91b6271a72cbbe390bf3ce2d13464090c3d1613/kernel_lib.php#L700

I've had to comment out the ", TRUE, $pStatusCode );" so that we get a simple header( 'Location: ' . $pUrl ); The trigger is normally from a 'page not found' and supplies that error code.

Not quite sure when this stopped working but it has been working for many years ...

piektd., 2020. g. 1. maijs, plkst. 12:20 — lietotājs Lester Caine (<lester@xxxxxxxx <mailto:lester@xxxxxxxx>>) rakstīja:

    My framework is using header() to redirect when an invalid page is hit,
    with the http_response_code providing the reason. This stopped working
    some time back and I had assumed it was just a problem with 'extra
    space' which I had not tracked down, but now I've eliminated that
    possibility ( and corrected a couple of smarty files ) I'm still just
    getting a blank screen!

    The problem seems to be the addition of $pStatusCode in header() ...
    have dropped that so header only uses the Url and things are are least
    redirecting. I suspect this is something to do with PHP changes as I'm
    currently using PHP7.2 and still keep hitting things which need to be
    reworked from the PHP5 base but I can't see any notes about this being
    changed in PHP ... what am I missing?

--
Lester Caine - G8HFL
-----------------------------
Contact - https://lsces.uk/wiki/Contact
L.S.Caine Electronic Services - https://lsces.uk
Model Engineers Digital Workshop - https://medw.uk
Rainbow Digital Media - https://rainbowdigitalmedia.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux