coreDev Posted September 16, 2007 Share Posted September 16, 2007 Hi everyone I'm in the process of building a 3 step application, Form 1 -> Form 2 -> Form 3 How can i set it for security purposes with PHP that if someone accesses Form 2 or Form 3 directly (ex User goes to www.url.com/form2.php instead of www.url.com/form1.php) that it will redirect them to Page1? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/69573-solved-form-handling-redirection/ Share on other sites More sharing options...
rarebit Posted September 16, 2007 Share Posted September 16, 2007 Start a session, then when goto page 1, set a session variable, say $_SESSION['page'] = 1, then when got page 2 check it for '1', then set to '2', etc... if not set then use this to redirect: header('Location: http://www.example.com/'); Quote Link to comment https://forums.phpfreaks.com/topic/69573-solved-form-handling-redirection/#findComment-349596 Share on other sites More sharing options...
coreDev Posted September 18, 2007 Author Share Posted September 18, 2007 thanks a TON rarebit. just want I needed Quote Link to comment https://forums.phpfreaks.com/topic/69573-solved-form-handling-redirection/#findComment-350232 Share on other sites More sharing options...
Jessica Posted September 18, 2007 Share Posted September 18, 2007 You could also just use one page, and only display the part of the form that is next, based on that session variable. That way users can't even try to skip ahead. Quote Link to comment https://forums.phpfreaks.com/topic/69573-solved-form-handling-redirection/#findComment-350235 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.