Forum Moderators: coopster
I have two simple text boxes in my <form> declaration
On the same page I gave PHP code on top which is called from within tha same html portion of the page at the bottom.
Is there a way to dynamically populate the existing text box in the html part using code from the PHP part?
Thanks in advance
Sure you can. Just invoke PHP within the HTML whenever/wherever you want.
<?php
$name = (isset($_POST['name'])) ? $_POST['name'] : 'Pointman';
?>
<form action="<?php print $_SERVER['PHP_SELF'];?>" method="post">
Name: <input name="name" type="text" value="<?php print $name;?>" /><br />
<input type="submit" name="Submit" value="Submit" />
</form>