Se connecter
Pas encore de compte ? Enregistrez-vous
 
Sample Web-Based Form Version imprimable
Écrit par Sam Azer   

How to make a web-based form using the new EZ-Form library from BNT Solutions. This article is a simple example, based on the ezform-basic.php example that's included in the ezform-1.0 package.

To view the complete documentation for this package, click here: EZ Web Forms via Email

Warning: You must turn off the TinyMCE text editor before you can enter PHP code into an article. The TinyMCE editor will automatically remove any PHP code that you try to submit into an article. To turn it off, log-in at the main web site home page, then select "Your Details" in the user menu. Your Editor choice is one of your details. You should change it to "NO WYSIWYG Editor." This will only change your setting, it will not change the settings for other users. Also, when you are done editing your web form, you can turn the TinyMCE editor back on (if you want to.)

Below is a sample form and the code required to make it work. Please see the notes in at EZ Web Forms for more information.

This is a test form

{kl_php} $form = new ezform(); $form->subject = "Executive Appointment Request"; $questions = array( array( "Text", 20, "Your First/Given Name" ), array( "Text", 20, "Your Last/Family Name" ), array( "Text", 32, "Your EMail Address" ), array( "Text", 20, "Desired Executive Appointment Date" ), array( "Text", 10, "Desired Executive Appointment Time" ), ); $form->show( $questions ); {/kl_php}

The code needed to produce the above form is shown here:
{kl_php} $string = <<subject = "Appointment Request"; \$questions = array( array( "Text", 20, "Your First/Given Name" ), array( "Text", 20, "Your Last/Family Name" ), array( "Text", 32, "Your EMail Address" ), array( "Text", 20, "Desired Appointment Date" ), array( "Text", 10, "Desired Appointment Time" ), ); \$form->show( \$questions ); EOT; echo "

{"; echo "kl_php"; echo "}
"; highlight_string( $string ); echo "
{"; echo "/kl_php"; echo "}"; {/kl_php}