c_coder Posted March 27, 2008 Share Posted March 27, 2008 Please help with the following... On my site's registration page I have an HTML form which passes variables on to a PHP page for validating user entries. (via $_POST) If all the entries seem valid, the same PHP page displays them back to the user for final confirmation. From here... when the user clicks "confirm", I need the next PHP page (that carries out the entry into the database) to still have access to the $_POST variables as entered by the user 2 pages back. Please help... Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/ Share on other sites More sharing options...
TimUSA Posted March 27, 2008 Share Posted March 27, 2008 pass them on as a hidden input Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/#findComment-502208 Share on other sites More sharing options...
BlueSkyIS Posted March 27, 2008 Share Posted March 27, 2008 hidden input can be manipulated. use sessions and pass them as session variables. Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/#findComment-502213 Share on other sites More sharing options...
c_coder Posted March 27, 2008 Author Share Posted March 27, 2008 Much appreciated BlueSkyIS. Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/#findComment-502298 Share on other sites More sharing options...
discomatt Posted March 27, 2008 Share Posted March 27, 2008 hidden input can be manipulated. use sessions and pass them as session variables. Why would it matter if the user manipulated their own input data? I do agree though, sessions are the cleanest way to do this. Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/#findComment-502303 Share on other sites More sharing options...
PFMaBiSmAd Posted March 27, 2008 Share Posted March 27, 2008 Because, if you have validated the input for things like xss code injection (which you must), when you pass the data through a hidden field, it can be replaced after it has been validated (so you would need to keep re-validating it) or if you have not validated the input for things like xss code injection, when you pass the data through a hidden field, the xss code can be executed. Edit: Passing existing data through a session will result in the quickest operating web site because you won't be sending unnecessary content to the browser just so it can send it back when the form is submitted. Link to comment https://forums.phpfreaks.com/topic/98164-variable-access-from-consecutive-pages/#findComment-502370 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.