Skip to content
Advertisement

Tag: redirect

GET URL parameter in PHP

I’m trying to pass a URL as a url parameter in php but when I try to get this parameter I get nothing I’m using the following url form: I’m trying to get it through: But nothing returned. What is the problem? Answer $_GET is not a function or language construct—it’s just a variable (an array). Try: In particular, it’s

How to create an error 404 page using PHP?

My file .htaccess handles all requests from /word_here to my internal endpoint /page.php?name=word_here. The PHP script then checks if the requested page is in its array of pages. If not, how can I simulate an error 404? I tried this, but it didn’t result in my 404 page configured via ErrorDocument in the .htaccess showing up. Am I right in

PHP generate file for download then redirect

I have a PHP app that creates a CSV file which is forced to download using headers. Here’s the relevant part of the code: What I’d like to do is redirect users to a new page after the file is built and the download prompt is sent. Just adding header(“Location: /newpage”) to the end didn’t work, expectedly, so I’m not

Advertisement