Re: HTML form online
| From: | Matthew Sims | Date: | Fri, 19 Nov 2004 20:04:01 +0000 |
| Subject: | Re: HTML form online | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202534@lists.php.net to get a copy of this message | ||
> I want to write php script that fill out HTML form online. Any ideas
> how to do it?
>
If you have a form such as this:
<form method="post" action="index.php">
<input type="text" name="line1" value="Testing One">
<input type="text" name="line2" value="Testing Two">
</form>
You would see two text lines filled in with Testing One and Testing Two.
So replace the value with whatever data you're gathering from PHP.
<form method="post" action="index.php">
<input type="text" name="line1" value="<?php echo $data1;
?>">
<input type="text" name="line2" value="<?php echo $data2;
?>">
</form>
For textarea's do as such:
<textarea name="textarea1"><?php echo $phpVar; ?></textarea>
--
--Matthew Sims
--<http://killermookie.org>