juanpablo Posted February 16, 2010 Share Posted February 16, 2010 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. Link to comment https://forums.phpfreaks.com/topic/192295-create-a-redirect-that-keeps-the-same-_post-data/ Share on other sites More sharing options...
Axeia Posted February 16, 2010 Share Posted February 16, 2010 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 Link to comment https://forums.phpfreaks.com/topic/192295-create-a-redirect-that-keeps-the-same-_post-data/#findComment-1013381 Share on other sites More sharing options...
juanpablo Posted February 18, 2010 Author Share Posted February 18, 2010 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? Link to comment https://forums.phpfreaks.com/topic/192295-create-a-redirect-that-keeps-the-same-_post-data/#findComment-1014071 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.