For those cases, I would use a checkbox to notify the script that information has been changed.
<?php
echo "<p>".$user->getVar('firstname')."</p>";
?>
<h3>Or to enter new information, check the box below</h3>
<input type="checkbox" name="change" value="true" onClick="enableForm('userinfo');" />
<form ....... >
<!--form information here, input boxes initially disabled, enabled by the javascript above-->
</form>
Then the script that validates the form info might look something like this:
<?php
if ($valid_user && $_POST['change'] != "true") {
//validate form information
$_SESSION['forminfo']['firstname'] = $user->getVar('firstname');
} else {
//validate form information
$_SESSION['forminfo']['firstname'] = $_POST['firstname'];
}
That way if the user does click the back button the session information holds the entered form information if the user is not registered or the check box has not been checked.