Image

Imagenonethewiser wrote in Imagephp

Clear selected form values when using sessions

Hello!

I posted a few days ago about some trouble I was having with getting my sessions to remember data when users navigated back and forth. I've managed to solve that one, but have hit my next challenge -- allowing the user can make changes to information they have already entered as part of the session.


I'm guessing I need to use session_unregister() for this, but I'm not sure exactly how to do it.

The pages look something like this at present, where the values in the session_register lines are those for the whole form, and the ones that appear in the main form itself are the ones I want to delete for this page. I also have another < div > section with navigation buttons, but that doesn't matter in this case:

$value) {
if (!empty($value)) {
$_SESSION[$key] = $value;
}
}?>

< html>


Hello .
Your third most recent job

Form goes here.
< input type="text" name="Coname3" maxlength="70" value="" />
< input type="text" name="citprov3" maxlength="70" value="" />
< input type="text" name="dates3" maxlength="50" value="" />


< TEXTAREA NAME="Resp3" ROWS="12" COLS="60" WRAP="on" value="">
</textarea>

< TEXTAREA NAME="Acco3" ROWS="12" COLS="60" WRAP="on" value="">
</textarea>
< INPUT TYPE="submit" name="emphiswork2.php" value="Add a job"></form>

</html>