문제

I have a large registration form and if a user makes any mistake and failed on server side validation then how could I show up the fields which were previously correct.

How can I send the post data back to the registration form?

도움이 되었습니까?

해결책

Store the POST values in session on your action page. In your html check if session value exists and then echo that. Expire the session once you are clear with server side validation.

다른 팁

whenever you are submitting the value of myvalue2 without filling the value of myvalue1 it will you an error with the posted data back

if(isset($_POST['submit']))
{
  if($_POST['myvalue1'])
   {
     $erromsg;
   }
}    

<input size="10" type="text" value="<?php echo $_POST['myvalue1']; ?> name="camp_click_value" id="xyz" />
<input size="10" type="text" value="<?php echo $_POST['myvalue2']; ?> name="camp_click_value" id="xyz" />
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top