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

www.redealmaker.net

2006-06-18 07:31:04 · 1 answers · asked by Aaron M 2 in Computers & Internet Programming & Design

1 answers

Depends on your webhost. I am no expert but i reccommend
writing an email handling form with php, it's much simpler than CGI script

Php will work well if your webhost supports PHP and SEND MAIL


Php has a built in function called mail.

bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]] )

on the page where your visitors type in thier information set variables for the fields if you havent.

add this to the code, before the body tag or somewhere in the body before the fields



form.php is the php form you have written to handle the email.

You can make it exactly the same as any other html page, save it as php
between your body tags type the following



?>
anything between those tags are processed as php.

try the following
$nameGot = ; //name of person
$from = "From: .\".$HTTP_POST_VARS["nameVar"]<".$HTTP_POST_VARS["emailSender"]."\">";

$subject = $HTTP_POST_VARS["subjectVar"]; // subject

$tel = $HTTP_POST_VARS["telVar"]; // telephone

$to = "Your name ";
$messageContent = $HTTP_POST_VARS["MessageVar"]."\n"."Name: ".$nameGot."\n"."Tel: ".$tel; // message
$messageContent = StripSlashes($messageContent); // take stuff out htat will confuse server or database

mail($to, $subject, $messageContent, $from)

mail is the function
the items with $ infront are variables
somethingVar is the variables you set for each field on your user input page.

This is just a simple example you are supposed to code checks to make sure users don't leave key fields blank, you are also supposed to check that they came from a vaild page from in your domain and some otehr security checks. I am sadly not an expert.

More info
http://www.php.net/

2006-06-18 08:30:29 · answer #1 · answered by jason b 5 · 1 0

fedest.com, questions and answers