4
Answers

How to display session value in textbox ?

Ajit N

Ajit N

5y
5.1k
1
Hello, I want to display session value in text box ,i tried some code but i didn't get output.
Here is my code....
  1. <?php  
  2.   
  3. session_start();  
  4. $pname=$_SESSION["pname"];  
  5. $rs=$_SESSION["rs"];  
  6.   
  7.     if($_SESSION["pname"]==TRUE){     
  8.       
  9. else  
  10.     {  
  11.           
  12.     }  
  13. ?>  
 and the HTML code
  1. <input type="text" class="form-control" name="name" placeholder="" required="" value="<?php echo $pname?>">  
 and i got this below output...
 
 
So help me how can i solve this ? 
Answers (4)