Ok, here's the code i have for sending registration form to my email. I got it from a script and i know it's not too clean...
Anywho, I was wondering, how I could make it also post this information into a .php in columns aswell as sending to my email..?
Thanks!
<?
$MailTo = ""; //recipient of the form results
$MailSubject = "Registration!"; //text in the Subject field of the mail
$MailHeader = "From:"; //text in the From field of the mail
$Envoi = 1; //give value 1 to the variable $Envoi
if ($disc == "") {
echo("<font face=verdana size=2>You have not read and agreed to the disclaimer, please do so!</font><br>");
$Envoi = 0;
}
else {
$MailBody = "Disclaimer: $disc\n";
}
if ($champ1 == ""){ //name of field 1
echo("<font face=verdana size=2>Error! Please enter your name.</font><br>"); //message to be displayed if the field is left empty
$Envoi = 0; //if field 1 is empty, variable $Envoi takes value 0
}
else {
$MailBody = "Name: $champ1\n"; //if field 1 has been completed, value is inserted in variable MailBody
}
if (!isset($champ2)){
echo("<font face=verdana size=2>You forgot to complete the handle field.</font><br>");
$Envoi = 0;
} else {
$MailBody .= "Handle: $champ2\n";
if (isset($champ3))
$MailBody .= "ICQ #: $champ3\n";
}
if (!isset($champ4)){
echo("<font face=verdana size=2>You forgot to complete the email field</font><br>");
$Envoi = 0;
} else {
$MailBody .= "Email Address: $champ4\n";
if (isset($champ5))
$MailBody .= "Certainty: $champ5\n";
$MailBody .= "Comments: $champ6\n";
}
//Routine for checkboxes
$MailBody .="Competitions : ";
$items = 5; //initiate possible # of items
for ($i = 1; $i <= $items; $i++) { //loop on # of items
$MailBody .= "$champ8[$i], "; //put results in variable MailBody
}
//Routine to send message
if ($Envoi == 1) { //Check that variable $Envoi has value 1
mail($MailTo, $MailSubject, $MailBody, $MailHeader); //message send
echo("<p><font face=verdana size=2>Your Registration has been sent.<br>Thankyou.<br>Click <a href=***>here</a> to go back.</font>"); //Confirmation message.
}
?>