Page 1 of 1

Inserting PHP as a form value

Posted: Mon Jul 31, 2006 12:01 am
by 4Boredom
I am trying to insert a php variable into a form text field, anyone know how?

Code: Select all

<tr>  
      <td align=center valign=top>Display Name: </td> 
      <td><input name=username type=text id=username value=<? $username ?>></td> 
    </tr>
This code didnt do anything

Posted: Mon Jul 31, 2006 12:03 am
by Burrito
you need to echo it:

Code: Select all

<tr>  
      <td align=center valign=top>Display Name: </td> 
      <td><input name=username type=text id=username value=<?php echo $username ?>></td> 
    </tr>

Posted: Mon Jul 31, 2006 12:36 am
by 4Boredom
thanks it works perfect.... thanks for the quick reply :)