Jump to content

Create a redirect that keeps the same $_POST data?


juanpablo

Recommended Posts

This is the current situation:

 

[*]User logs in.

[*]User navigates to a certain page.

[*]User fills the forms and takes too long to complete the form

[*]User submits the form

[*]Program says "You are not logged in, bla bla bla" and shows a login box

[*]User logins but is redirected to the main page.

[*]Submitted data is lost.

What i want, however, is to create a redirect that not only will it load the previous page once the user logs in but it should also redirect the user to the page he was previously browsing AND keep the $_POST array intact.

 

Is there any way to do this? I am currently using:

 

header("Location: page.php");

 

I'd also would like to pass parameters to the login.php function without using session variables. The login.php is executed through a header("Location: login.php"); just like the redirect that the login creates once the user logs in.

Stick it in the session.

If there is any sensitive information (banknumbers, passwords etc) this would however not be something you'd want to do.

 

If it's just a forum post or something like that, then go ahead :)

 

The problem with session variables is that:

 

1) Session expires

2) Person may have more than one window open.

 

Any ideas?

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.