English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to add an email form into an html page that will let people select an event on a v.i.p. list of different shows and have that perticular event in the subject for the email to then be sent to the host of the event with the number of people to put on their guestlist. I'm guessing I'll have to use some kind of drop-down box with the events in the dropdown box and then have that create the subject line and then the user just types in their info.
Is there any sites that have this kind of code to add to a Dreamweaver made page?

2006-10-23 07:18:35 · 2 answers · asked by J23 3 in Computers & Internet Programming & Design

2 answers

Haven't used Dreamweaver, but it's pretty standard PHP code that can do that for you.

Example using variables, these can be pieces of information that were typed in on the Form or calulated from something else.


$headers = 'From: whomever ' . "\n";
// The message
$message = "This is the start of the message: \n\n";
$message .= "------------------\n";
$message .= "First Name: $first_name\n";
$message .= "Last Name: $last_name\n";
$message .= "Email: $email\n";
$message .= "end of the message\n";
// Chop lines > 70 characters
$message = wordwrap($message, 70);
// Send
mail('foo@bar.com', 'Subject', $message,$headers);

Multiple recipients.

/* recipients */
$subject = "Things to do";

$to = "mary@littlelamb.com" . ", " ; // the comma needs to be there
$to .= "wendy@neverland.com";
mail($to, $subject, $message, $headers);

2006-10-23 07:33:32 · answer #1 · answered by wizzie b 3 · 2 0

This can't be done using just HTML (as the previous poster was sort of getting at). The only way is to use a back end system (PHP, ASP, etc.) that your server system supports. Unfortunately, if you are running this site on a free system that doesn't allow you access to the system itself, you probably won't be able to impliment something like this.

Otherwise it is a fairly simple and common chunk of code in any language.

In psudo code:

//get POST variables from HTML form -



//set up recipient address
//set up content of the email
//send mail using the correct function [in PHP its just "mail($to, $subj, $body, $otherHeaders);"]

//done

2006-10-23 14:42:40 · answer #2 · answered by John J 6 · 0 0

fedest.com, questions and answers