I am preparing a webpage that contains several forms, each one has the usual input text and submit button which calls a php script. The thing I don’t like much is that whenever I press one of the submit button the others input text are reset. I am wondering if there is a way to keep the value of the input texts the one I have entered even if I’ll press a submit button..
thanks!
I am preparing a webpage that contains several forms, each one has the usual
Share
The simplest solution is that you can store data into $_SESSION … like :
$_SESSION[‘forms_data’][‘firts_form_name’] = array(
‘field1’ => $_REQUEST[‘field1’],
‘field2’ => $_REQUEST[‘field2’]
….
);
and for others the same principle.
then you can retrieve them again from the $_SESSION arr,