Jump to content

Displaying variables in a text box


Recommended Posts

I could be all wrong but i think you are wanting to display the variable in the Text field box, which can be accomplished like this:
[code]
<?php $name = 'TESTING'; ?>
<form id="form1" name="form1" method="post" action="">
  <label>Logged in as:
  <input type="text" name="textfield" value="<?php echo $name; ?>"/>
  </label>
</form>
[/code]
this will display the variable $name in the text box.  If this isn't what you are looking for.....sorry!
// I think you have to create a file which willl be your page form

/*save this as [b]input.html[/b] */

<form method="post" action="display.php">
  <label>Logged in as:
  <input type="text" name="username" value="<?php echo $name; ?>"/>
  </label>
</form>


//then create another file and save as display.php which will be your script

<?php

        $username=$_POST['username'];

        echo "Logged In as ".$username;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.