Ok so I am doing an editprofile feature for my website but how can I do it so it fills the form with its current data. The current data is $row[fname] and part of the form is <input type="text" size="25" maxlength="255" class="input" name="fname"> I know I need to use the value=" " tag but should I echo the whole form tag or just inside the value tag etc.. Please show me how I should and I will +rep.
One way to do it. <?php echo '<input type="text" size="25" maxlength="255" class="input" value="'.$row['fname'].'" name="fname">'; ?> PHP: A different way to do it. <?php $var = $row['fname']; ?> <input type="text" size="25" maxlength="255" class="input" value="<?php echo $var; ?>" name="fname"> PHP: