Hi people,
I must be honest, I am not at all fluent in the php scripting language and was wondering if anyone can help me with a problem:
I am using the code included at the very bottom of this message to send a simple email within the flash environment and includes the fields; NAME, EMAIL AND MESSAGE.
How do add extra fields that include a drop down menu and tick boxes?
Here are the fields I am trying to add:
Name: (ALREADY SET UP)
Sex: (M/F) << tick box
D.O.B
College: (dropdown list with Birmingham, Brighton, Bristol, Cambridge, Cardiff, Coventry, Edinburgh, Glasgow, Leeds, Leicester, Liverpool, London, Manchester, Newcastle, Nottingham, Oxford, Salford, Sheffield)
Course:
Year:
NUS/Student no:
e-mail: (ALREADY SET UP)
current mobile no:
are you looking for the following (please tick)
job (part time / casual)
room/house
Here is the PHP code that I am using:
<?php
/***************************************************\
* PHP 4.1.0+ version of email script. For more
* information on the mail() function for PHP, see
* \***************************************************/
// First, set up some variables to serve you in
// getting an email. This includes the email this is
// sent to (yours) and what the subject of this email
// should be. It's a good idea to choose your own
// subject instead of allowing the user to. This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.
$sendTo = "info@email.com";
$subject = "Message received from the Info Site";
// variables are sent to this PHP page through
// the POST method. $_POST is a global associative array
// of variables passed through this method. From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.
// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] .">\r\n";
// next include a Reply-To:
$headers .= "Reply-To: " . $_POST["email"];
// now we can add the content of the message to a body variable
$message = $_POST["message"];
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);
?>
Sorry about the long message but I would appreciate ANY help from you genius'
Thanks....
I must be honest, I am not at all fluent in the php scripting language and was wondering if anyone can help me with a problem:
I am using the code included at the very bottom of this message to send a simple email within the flash environment and includes the fields; NAME, EMAIL AND MESSAGE.
How do add extra fields that include a drop down menu and tick boxes?
Here are the fields I am trying to add:
Name: (ALREADY SET UP)
Sex: (M/F) << tick box
D.O.B
College: (dropdown list with Birmingham, Brighton, Bristol, Cambridge, Cardiff, Coventry, Edinburgh, Glasgow, Leeds, Leicester, Liverpool, London, Manchester, Newcastle, Nottingham, Oxford, Salford, Sheffield)
Course:
Year:
NUS/Student no:
e-mail: (ALREADY SET UP)
current mobile no:
are you looking for the following (please tick)
job (part time / casual)
room/house
Here is the PHP code that I am using:
<?php
/***************************************************\
* PHP 4.1.0+ version of email script. For more
* information on the mail() function for PHP, see
* \***************************************************/
// First, set up some variables to serve you in
// getting an email. This includes the email this is
// sent to (yours) and what the subject of this email
// should be. It's a good idea to choose your own
// subject instead of allowing the user to. This will
// help prevent spam filters from snatching this email
// out from under your nose when something unusual is put.
$sendTo = "info@email.com";
$subject = "Message received from the Info Site";
// variables are sent to this PHP page through
// the POST method. $_POST is a global associative array
// of variables passed through this method. From that, we
// can get the values sent to this page from Flash and
// assign them to appropriate variables which can be used
// in the PHP mail() function.
// header information not including sendTo and Subject
// these all go in one variable. First, include From:
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"] .">\r\n";
// next include a Reply-To:
$headers .= "Reply-To: " . $_POST["email"];
// now we can add the content of the message to a body variable
$message = $_POST["message"];
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $message, $headers);
?>
Sorry about the long message but I would appreciate ANY help from you genius'
Thanks....