hai friends if i execute the below code means, Iam able to get the result stored in fname and the second time if i enter the value it is replacing the old value Now what i need is for the first time if i enter the value as x, it should display as x for the second time if i enter the value as y it should display as xY for the third time if i enter the value as z it should display as xyz ................ for this scenario what i need to change in the below code, any body help me file name: time.php <?php if(isset($_POST["sub"])){ $display=$_POST["fname"]; echo $display; } ?> <form method="post" action="time.php"> <input type="text" name="fname"> <input type="submit" name="sub" value="submit"> </form> Thanks for ur help in advance
<?php if (isset($_POST["sub"])) { $temp = htmlspecialchars($_POST['temp'] . $_POST['fname']); echo $temp; } ?> <form method="post" action="time.php"> <input type="text" name="fname"> <input type="submit" name="sub" value="submit"> <input type="hidden" value="<?php echo isset($temp) ? $temp : ''; ?>" name="temp" /> </form> PHP: