Tuesday, May 13, 2008

Form Processing with PHP

Use the Dreamweaver to create the form. You may find this tutorial helpful.

To email the html form, a link to the external php code has to be placed inside the .html right before </head> tag.

<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css">


To create feedback.php on the same directory of the .html file; for more info see this tutorial.

The following code is an example that I used to email the promotion oracle inquiry form:

// prepare email body text$Body = "";
$Body .= "Name: $name\n";
$Body .= "Company: $company\n";
$Body .= "Email: $email\n";
$Body .= "Website: $website\n";
$Body .= "Info: $detail\n";
$Body .= "Budget: $budget\n";
$Body .= "Interest: $ints";
$Body.=($_POST['marcom'])?"marcom ":" - ";
$Body.=($_POST['lead'])?"lead ":" - ";
$Body.=($_POST['promo'])?"promo ":" - ";
$Body.=($_POST['marketing'])?"marketing ":" - ";
$Body.="\n";$Body.= "Timeline: $timeline\n";

No comments:

Post a Comment