nblackwood Posted February 16, 2010 Share Posted February 16, 2010 Hi all, I have this problem that I can't quite figure out. I know how to post data to a page via $_POST and also using sessions. I know that placing confirm.php in the "action=" tag of form will put the information to the page specified, but I want it to do that and also redirect the user to example.php. The confirm.php is the confirmation page where all the collected data will be displayed to the user. The client I'm building this for doesn't want to use cookies. Is there a simple way I've overlooked to accomplish this? I am no noob, but this has been one I've tried to figure out in the past. I should also note that there is no sensitive information being redisplayed. Link to comment https://forums.phpfreaks.com/topic/192308-posting-information-to-placeholder/ Share on other sites More sharing options...
samtwilliams Posted February 16, 2010 Share Posted February 16, 2010 Is there a reason why you wouldn't want to use cookies? Mobile devices? Anyway you could post the data to one page store it in an array and the simply post the data onwards or even pass it through the url and use the $_GET[] function obtain it. Say if you had three files your form.html, middle.php and confirm.php and you wanted to pass the data all the way to the end without a session then it may look like this. So form.html would pass the data to middle.php Then middle.php; <?PHP $forename = $_POST['forename']; echo "<a herf=\"http://yourdomain.com/confirm.php?forename={$forename}\">Next Step</a>"; ?> On this page you would construct a link that looked similar then when the use proceeds they pass the information through the url. Then confirm.php; <?PHP $forename = $_GET['forename']; ?> Please be aware that there are issues with this and you should sanitize your data before inserting to databases etc. Hope this helps. Sam Link to comment https://forums.phpfreaks.com/topic/192308-posting-information-to-placeholder/#findComment-1013405 Share on other sites More sharing options...
nblackwood Posted February 16, 2010 Author Share Posted February 16, 2010 Well, that's not exactly what I was looking for, but thanks for the reply. To answer the question, yes. There are plans to convert it to be mobile compatible in the future, and they want as little changing later as possible. Anywho, I will provide a small program flow to demonstrate what I was looking for. The numbers are the pages in my program flow. 1-2-3-4-5-6-7-8 ---- Confirm ----- MySQL/Email \ \ \ | / / / / | \ \ \|/ / / / / Page outside program flow(include) I hope this diagram made my original description of the problem a bit more clear. Thanks to anyone who inputs on this problem. Link to comment https://forums.phpfreaks.com/topic/192308-posting-information-to-placeholder/#findComment-1013452 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.