Matt Matijevich wrote:
[snip]
Can anyone suggest a PHP solution to creating a form that gets built
after a client enters a variable?
[/snip]
php runs on your server so to build the forms based on a user entered
form field, the form has to be submitted, so you would have to use
javascript to automatically submit the form or have the user push a
submit button to susbmit the form so php can do its thing.
I don't have a solution or tutorial per se'... Google might. Here is a
small example of a self processing form, if it helps.
<?php
if((empty($_POST['var01'])) || (empty($_POST['var02']))) {
$form = "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
<input name=\"var01\">
<input name=\"var02\">
<input type=\"submit\" value=\"Save\">
<input type=\"reset\" value=\"Reset\">
</form>";
} elseif((!empty($_POST['var01'])) || (!empty($_POST['var02']))) {
$form = "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
<input name=\"var01\" value="\$_POST[var01]\">
<input name=\"var02\" value="\$_POST[var02]\">
<input type=\"submit\" value=\"Save\">
<input type=\"reset\" value=\"Reset\">
</form>";
} else {
$form = "$_POST[var01]
$_POST[var02]"; }
echo $form;
?>
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php