Jump to content

How to recognize original redirection document


Matic

Recommended Posts

Lets say I have a form in form.php and when I click submit all inputted data is sent to model.php for database manipulation etc.. and then when everything is done the model.php redirects user back to form.php using function:

header('Location:form.php');

How in the blazing hell can form.php recognize I was redirected there from model.php ? I am so lost about this for so long now, I tried $_SERVER['HTTP_REFERER'] and everything and I just get an echo with my current page location. I want to get an echo of the model.php on my form.php

 

 

You could set a session variable on model.php, something like

 

$_SESSION['model_redirect'] = true;

 

Then on the form.php page, check to see if the session variable is set.

If it is, then it was redirected from model.php, else it wasn't.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.