how to remember input data in the forms even after refresh page?

后端 未结 10 1508
日久生厌
日久生厌 2020-11-27 17:11

what to do in order to make the form remember the previous input or the current input of the user even after he/she refreshed the page ?

should I do ,



        
10条回答
  •  一个人的身影
    2020-11-27 17:51

    Session is a good way to store and remember data but why complicate things? Consider if the form has many fields, developer has to store lots of values in session. Why not simply print or echo.

    Example:

    Form is submitted with input ssName and hidden field ssAct with value of send

    Get the ssName and ssAct on form submit

    $ssAct=$_REQUEST["ssAct"];
    $ssName=$_REQUEST["ssName"];
    

    and the form

    ">
    
    

    On submit name will be echoed if it was submitted and was not empty.

提交回复
热议问题