H
Hope
Guest
I have a form containing 19 different php variables. Over three pages, I a) get the information from the applicant, b) confirm the information, and c) send an email to me with the info and a "Thank you for applying" page is displayed. Everything works okay until they hit the final submit button that sends the email.
I tried passing the info using 19 variables inside line: mail($to, $subject, $firstname,$lastname ..etc.. $headers); however it said I had too many variables to pass through.
I tried to combine variables into one variable ($mail_body), resulting in the mailto line:
mail($to, $subject, $mail_body, $headers);
and the php script seemed happy. However, when I got the email, I got the html code ("First Name:" and "Last Name:" but no PHP variable afterwards. In other words, instead of "First Name: John" I only got "First Name:". If I try to pass only the variables, then I wouldn't know what the answer was to.
A smaller version of the mailsent.php file is as follows:
<?php
$plyr_f_name = $_POST['plyr_f_name']; // Player's First Name
$plyr_l_name = $_POST['plyr_l_name']; // Player's Last Name
$plyr_city = $_POST['plyr_city']; // Player's City
$plyr_state = $_POST['plyr_state']; // Player's State
$plyr_email = $_POST['plyr_email']; //Player's Email
$plyr_phone = $_POST['plyr_phone']; // Player's Phone
$plyr_age = $_POST['plyr_age']; // Player's Age
$plyr_avail = $_POST['plyr_avail']; //Player's Availability
$plyr_race1 = $_POST['plyr_race1']; // Player's 1st Race Choice
$plyr_class1 = $_POST['plyr_class1']; // Player's 1st Class Choice
$to = "[email protected]"; // Recipient's email
$subject = "Application"; // Subject
$mail_body = "First Name: $plyr_f_name // This combines all form variables to email body for mail command
Last Name: $plyr_l_name
City: $plyr_city
State: $plyr_state
Email: $plyr_email
Phone Number: $plyr_phone
Age: $plyr_age
Availability: $plyr_avail
1st Character and Race Preference: $plyr_race1 $plyr_class1";
$headers = "From: " . $_POST['plyr_email'] . "\n";
if (isset($_POST['Send'])) {
mail($to, $subject, $mail_body, $headers); //mail command
print ("<h1>Message Sent</h1><br /><p>Please allow 48 hours for the Dungeon Master to review your application. Upon approval, you will receive an email with a login name and default password for the site.</p>");
}
?>
Any thoughts?
I tried passing the info using 19 variables inside line: mail($to, $subject, $firstname,$lastname ..etc.. $headers); however it said I had too many variables to pass through.
I tried to combine variables into one variable ($mail_body), resulting in the mailto line:
mail($to, $subject, $mail_body, $headers);
and the php script seemed happy. However, when I got the email, I got the html code ("First Name:" and "Last Name:" but no PHP variable afterwards. In other words, instead of "First Name: John" I only got "First Name:". If I try to pass only the variables, then I wouldn't know what the answer was to.
A smaller version of the mailsent.php file is as follows:
<?php
$plyr_f_name = $_POST['plyr_f_name']; // Player's First Name
$plyr_l_name = $_POST['plyr_l_name']; // Player's Last Name
$plyr_city = $_POST['plyr_city']; // Player's City
$plyr_state = $_POST['plyr_state']; // Player's State
$plyr_email = $_POST['plyr_email']; //Player's Email
$plyr_phone = $_POST['plyr_phone']; // Player's Phone
$plyr_age = $_POST['plyr_age']; // Player's Age
$plyr_avail = $_POST['plyr_avail']; //Player's Availability
$plyr_race1 = $_POST['plyr_race1']; // Player's 1st Race Choice
$plyr_class1 = $_POST['plyr_class1']; // Player's 1st Class Choice
$to = "[email protected]"; // Recipient's email
$subject = "Application"; // Subject
$mail_body = "First Name: $plyr_f_name // This combines all form variables to email body for mail command
Last Name: $plyr_l_name
City: $plyr_city
State: $plyr_state
Email: $plyr_email
Phone Number: $plyr_phone
Age: $plyr_age
Availability: $plyr_avail
1st Character and Race Preference: $plyr_race1 $plyr_class1";
$headers = "From: " . $_POST['plyr_email'] . "\n";
if (isset($_POST['Send'])) {
mail($to, $subject, $mail_body, $headers); //mail command
print ("<h1>Message Sent</h1><br /><p>Please allow 48 hours for the Dungeon Master to review your application. Upon approval, you will receive an email with a login name and default password for the site.</p>");
}
?>
Any thoughts?