Jump to content

[SOLVED] Header Question -- Poor Design? yes I read Akitchin and Toplay's Header thread


thepip3r

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.