Jump to content

Archived

This topic is now archived and is closed to further replies.

kaspm

multipage form

Recommended Posts

Hi, I have a multipage form I want to send to an email address. Do I have to use:

mail($whatever && $next

for all the fields or would there be an eaiser way to do it.
Thanks

Share this post


Link to post
Share on other sites
[!--quoteo(post=371058:date=May 3 2006, 01:40 PM:name=kaspm)--][div class=\'quotetop\']QUOTE(kaspm @ May 3 2006, 01:40 PM) [snapback]371058[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi, I have a multipage form I want to send to an email address. Do I have to use:

mail($whatever && $next

for all the fields or would there be an eaiser way to do it.
Thanks
[/quote]

It really depends on how you want to format your message, here is an example of a way to send the mail:

[code]
//this will show whatever is entered in the fullname input on your form
//<input type="text" name="fullname">
$mail_body = "Name: " . $_REQUEST['fullname'] . "\n";
// "\n" sends it to the next line
$mail_body .= "Email: " . $_REQUEST['email'] . "\n";
$mail_body .= "Message: " . $_REQUEST['message'];
// ".=" is used for adding to the end of the string that already exists

mail("youremail@whatever.com", "Your Subject", $mail_body);
[/code]

If you would like to use HTML in your message or you would like to modify the e-mail headers so that you can use CC, BCC, or other features. For more information about using the mail function and some better examples than the one i wrote above go straight to the comments on the online documentation.

[a href=\"http://www.php.net/function.mail\" target=\"_blank\"]http://www.php.net/function.mail[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.