rocknbil - 4:31 pm on Sep 28, 2011 (gmt 0)
This script is horribly insecure, look into input cleansing . . . .
at any rate, look at how the "message" gets into the email body. In the form you have
<textarea name="message" rows="18" cols="60" class="input" >
which is parsed by the script here,
$message = $_REQUEST['message'] ;
.. storing the input value in "$message" and actually placed in the email here.
mail( "email@example.com", "Message from somedomain.com",
$message, "From: $email" );
So the first question is, where do you want your additional fields to appear?
Let's "prepend" them to "$message" for example. The fields in the form,
Votre Nom: <input name="name" type="text" class="input" /><br /><br>
Votre Tel: <input name="tel" type="text" class="input" /><br /><br>
Then "capture" them in new variables, following the style,
$message = $_REQUEST['message'];
$nm = $_REQUEST['name'];
$tel = $_REQUEST['tel'];
// Then prepend it to message. We do this by re-storing "$message" back into $message as a new string:
$message = "
Then when you go to email, "$message" contains the new field data.
Again, you might look into protecting your script with input filtering, it's a large topic but form abuse is rampant. Some good search terms are email injection, database injection, cleanse input . . .