I am new to PHP, but I have got an email form to work but I think I am haveing trouble passing variables correctly. I have a Flash web site that has a form on it. The form has 7 fields that I am trying to submit via email. So far it is working but the only field that is sending is FirstName. The fields that I have are as follows:
firstName, lastName, phone, altPhone, email, address, and commentBox.
My codes is as follows:
<?php
$sendTo = "lou@selway.umt.edu";
$subject = "Design Turf Career Oppurtunities Reply";
$headers = "From: " . $_POST["firstName"] ;
$headers .= "<" . $_POST["email"] .">\r\n";
$message = "First Name: " . $_POST["firstName"];
mail($sendTo, $subject, $message, $headers);
?>
Newbie to PHP needs help with email form?
Moderator: General Moderators
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
Might be easyer to do some with this if you post the form code aswell 
<?php
$sendTo = "lou@selway.umt.edu";
$subject = "Design Turf Career Oppurtunities Reply";
$headers = "From: " . $_POST["firstName"] ;
$headers .= "<" . $_POST["email"] .">\r\n";
$message = "First Name: " . $_POST["firstName"];
mail($sendTo, $subject, $message, $headers);
?>
Code: Select all
// this looks so much better
//Code: Select all
youre code$sendTo = "lou@selway.umt.edu";
$subject = "Design Turf Career Oppurtunities Reply";
$headers = "From: " . $_POST["firstName"] ;
$headers .= "<" . $_POST["email"] .">\r\n";
$message = "First Name: " . $_POST["firstName"];
mail($sendTo, $subject, $message, $headers);
?>
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
The form is built in Flash so it is a little hard to post the code. I have seven fields and each field has a variable name like the ones I posted.
the variables are as follows:
firstName, lastName, phone, altPhone, email, address, and commentBox.
They are all input fields in a Flash movie clip. The firstName field is working, I just can't figure out how to "POST" more than one field. Any ideas. Can I just add another line somehow for each field. I have tried to add more $message commands, but when I do, nothing works. How do I go about getting all the fields to POST?
the variables are as follows:
firstName, lastName, phone, altPhone, email, address, and commentBox.
They are all input fields in a Flash movie clip. The firstName field is working, I just can't figure out how to "POST" more than one field. Any ideas. Can I just add another line somehow for each field. I have tried to add more $message commands, but when I do, nothing works. How do I go about getting all the fields to POST?
Code: Select all
" . $_POST["firstName"] " ', ' " . $_POST["otherfield"] " ',' " ectCode: Select all
/* slight mistake that should be.. */
" '. $_POST["firstName"] . " ', ' " . $_POST["otherfield"] . " ',' " ect
Last edited by ol4pr0 on Tue Feb 17, 2004 2:41 pm, edited 5 times in total.
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm