Image

Imagequecojones wrote in Imagephp 😯confused

New guy...

Hey, I'm new to the community and PHP in general (sort of). I have a small site and along with being able to use PHP I just found out that I can have my own custom 404 page. I want to try something, but I need some help.

Pardon my ignorance, but here goes...

I want to have the 404 page automagically redirect to the home page of the site. I want to include a script in the home page that somehow notices when this happens and displays (along with the normal page) a message explaining what happened and why.

I'm thinking of creating a variable in the 404 page and then having the script in the home page check for that variable (if statement) and either display the normal page or the one with the extra information). I have $x = "something"; in the 404 page and if ($x == "something") { echo("The extra information..."); } near the beginning of the home page. My question is, how do I pass the variable from one page to the next?