thepip3r Posted March 24, 2009 Share Posted March 24, 2009 so i have a technical support feedback survey form for a company. and i give the users an initial form to submit first name, last name, and company name. Once that form's submit button is clicked, those vals are stored in $_SESSION vars. The feedback survey is the next form that is presented and consequently submitted. The vals get written to a db and a cute little success message outputs. Now in an effort to prevent duplicate refresh-button submissions, I set $_SESSION['survey_submitted'] = true. When that conditional fires (if someone refreshes the page after they've already submitted the survey), I have another cute message stating that they have already submitted a survey and cannot submit another w/o closing and reopening their browser. I've tried something like: if (isset($_GET['resubmit'])) { session_destroy_real(); } function session_destroy_real() { session_regenerate_id(); session_destroy(); } ...but as you know i get header errors since multiple lines of html have already been outputted to the screen. so my question is... within one page, is there a way to actually destroy and regenerate a new session for the user w/o closing and reopening browser? p.s. i know this has been answered a thousand different ways so if the answer is no, a simple "no" will suffice and i'll try to engineer a different method around this problem. TIA. Link to comment https://forums.phpfreaks.com/topic/150976-solved-header-question-poor-design-yes-i-read-akitchin-and-toplays-header-thread/ Share on other sites More sharing options...
thepip3r Posted March 24, 2009 Author Share Posted March 24, 2009 nm... i'm making it more complicated that it needs to be... just manually wiping all pertinent values will do the trick. sorry to bother. Link to comment https://forums.phpfreaks.com/topic/150976-solved-header-question-poor-design-yes-i-read-akitchin-and-toplays-header-thread/#findComment-793202 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.