I have a form with some fields like text , select etc. I need to set the variable using php. I have some values in the session which is to be put in the text field.
asked Jan 11, 2012 at 5:40
defiant
3,36312 gold badges44 silver badges71 bronze badges
2 Answers 2
you can put like this,
<input type="text" value="<?php echo $SESSION['variable_name'];?>" />
<textarea><?php echo $SESSION['variable_name'];?></textarea>
answered Jan 11, 2012 at 5:45
Avinash
8012 gold badges12 silver badges26 bronze badges
Sign up to request clarification or add additional context in comments.
1 Comment
defiant
exactly what I wanted. Thanks! :D
You don't say where your variables come from, but if you need to move them from one page to another, you will have to use session_start(); at the beginning of each php page.
sjngm
13k16 gold badges90 silver badges118 bronze badges
Comments
default