Check box value don't show up in email.

  • postonoh
  • Newbie
  • Newbie
  • postonoh
  • Posts: 5

Post 3+ Months Ago

I am trying to create php script that when a persons has selected yes on the form for tickets
it emails name and email to emailaddress2 and email all the other information filled out on the form to emailaddress1

This is what is happening when a user select yes or no it is still emails the information listed in the function flashseed ()to emailaddress2

I need that if the say no not to call the function.

Also, I have four check boxes on the page I need to know the value of the checked boxes when I receive the emails when they register.

So one if person registers and select yes they need tickets. emailaddress2 should receive email with Name and email address. emailaddress1 should receive email with Company Name, Name, Address, City, State, Zip, tickets(yes or no), Check box value(Rock, Jazz, Classical, Soul).

I hope I am explaining this OK.

Code: [ Select ]
<?php
function flashseed()
{
    /* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress2';


/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$yes = $_POST['tickets'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
    
}

/* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress1';

/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$phone = $_POST['Phone_Number'];
$company = $_POST['Company'];
$address = $_POST['Address'];
$city= $_POST['City'];
$state = $_POST['State'];
$zip = $_POST['Zip_Code'];
$yes = $_POST['tickets'];
if (flashseed($yes) == "Yes")
$checkbox = $_POST['ckboxGrp1'];
foreach ($checkbox as $chkbx)
{
    echo "$chkbx is checkeg\n";
}

$body = <<<EOD
<br><hr><br>
Company: $company <br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Address: $address<br>
City: $city <br>
State: $state <br>
Postal Code: $zip <br>
Tickets: $yes <br>
Certification: $chkbx <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);


/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=index.html">
<style type="text/css">
<!--
body {
background-color: #244a30;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fab323;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}

-->
</style>
</head>
<blockquote><center>
<div align="center">Registration Complete!<br>
You will return to company in a few seconds !</div>
</center></blockquote>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
  1. <?php
  2. function flashseed()
  3. {
  4.     /* Email Variables */
  5. $emailSubject = 'Event';
  6. $webMaster = 'emailaddress2';
  7. /* Data Variables */    
  8. $name = $_POST['Name'];
  9. $email = $_POST['Email'];
  10. $yes = $_POST['tickets'];
  11. $body = <<<EOD
  12. <br><hr><br>
  13. Name: $name <br>
  14. Email: $email <br>
  15. EOD;
  16. $headers = "From: $email\r\n";
  17. $headers .= "Content-type: text/html\r\n";
  18. $success = mail($webMaster, $emailSubject, $body,
  19. $headers);
  20.     
  21. }
  22. /* Email Variables */
  23. $emailSubject = 'Event';
  24. $webMaster = 'emailaddress1';
  25. /* Data Variables */    
  26. $name = $_POST['Name'];
  27. $email = $_POST['Email'];
  28. $phone = $_POST['Phone_Number'];
  29. $company = $_POST['Company'];
  30. $address = $_POST['Address'];
  31. $city= $_POST['City'];
  32. $state = $_POST['State'];
  33. $zip = $_POST['Zip_Code'];
  34. $yes = $_POST['tickets'];
  35. if (flashseed($yes) == "Yes")
  36. $checkbox = $_POST['ckboxGrp1'];
  37. foreach ($checkbox as $chkbx)
  38. {
  39.     echo "$chkbx is checkeg\n";
  40. }
  41. $body = <<<EOD
  42. <br><hr><br>
  43. Company: $company <br>
  44. Name: $name <br>
  45. Email: $email <br>
  46. Phone: $phone <br>
  47. Address: $address<br>
  48. City: $city <br>
  49. State: $state <br>
  50. Postal Code: $zip <br>
  51. Tickets: $yes <br>
  52. Certification: $chkbx <br>
  53. EOD;
  54. $headers = "From: $email\r\n";
  55. $headers .= "Content-type: text/html\r\n";
  56. $success = mail($webMaster, $emailSubject, $body,
  57. $headers);
  58. /* Results rendered as HTML */
  59. $theResults = <<<EOD
  60. <html>
  61. <head>
  62. <title>sent message</title>
  63. <meta http-equiv="refresh" content="3;URL=index.html">
  64. <style type="text/css">
  65. <!--
  66. body {
  67. background-color: #244a30;
  68. font-family: Verdana, Arial, Helvetica, sans-serif;
  69. font-size: 20px;
  70. font-style: normal;
  71. line-height: normal;
  72. font-weight: normal;
  73. color: #fab323;
  74. text-decoration: none;
  75. padding-top: 200px;
  76. margin-left: 150px;
  77. width: 800px;
  78. }
  79. -->
  80. </style>
  81. </head>
  82. <blockquote><center>
  83. <div align="center">Registration Complete!<br>
  84. You will return to company in a few seconds !</div>
  85. </center></blockquote>
  86. </div>
  87. </body>
  88. </html>
  89. EOD;
  90. echo "$theResults";
  91. ?>
  • postonoh
  • Newbie
  • Newbie
  • postonoh
  • Posts: 5

Post 3+ Months Ago

I am trying to create php script that when a persons has selected yes on the form for tickets
it emails name and email to emailaddress2 and email all the other information filled out on the form to emailaddress1

This is what is happening when a user select yes or no it is still emails the information listed in the function flashseed ()to emailaddress2

I need that if the say no not to call the function.

Also, I have four check boxes on the page I need to know the value of the checked boxes when I receive the emails when they register.

So one if person registers and select yes they need tickets. emailaddress2 should receive email with Name and email address. emailaddress1 should receive email with Company Name, Name, Address, City, State, Zip, tickets(yes or no), Check box value(Rock, Jazz, Classical, Soul).

I hope I am explaining this OK.

Code: [ Select ]
<?php
function flashseed()
{
    /* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress2';


/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$yes = $_POST['tickets'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
    
}

/* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress1';

/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$phone = $_POST['Phone_Number'];
$company = $_POST['Company'];
$address = $_POST['Address'];
$city= $_POST['City'];
$state = $_POST['State'];
$zip = $_POST['Zip_Code'];
$yes = $_POST['tickets'];
if (flashseed($yes) == "Yes")
$checkbox = $_POST['ckboxGrp1'];
foreach ($checkbox as $chkbx)
{
    echo "$chkbx is checkeg\n";
}

$body = <<<EOD
<br><hr><br>
Company: $company <br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Address: $address<br>
City: $city <br>
State: $state <br>
Postal Code: $zip <br>
Tickets: $yes <br>
Certification: $chkbx <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);


/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=index.html">
<style type="text/css">
<!--
body {
background-color: #244a30;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fab323;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}

-->
</style>
</head>
<blockquote><center>
<div align="center">Registration Complete!<br>
You will return to company in a few seconds !</div>
</center></blockquote>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
  1. <?php
  2. function flashseed()
  3. {
  4.     /* Email Variables */
  5. $emailSubject = 'Event';
  6. $webMaster = 'emailaddress2';
  7. /* Data Variables */    
  8. $name = $_POST['Name'];
  9. $email = $_POST['Email'];
  10. $yes = $_POST['tickets'];
  11. $body = <<<EOD
  12. <br><hr><br>
  13. Name: $name <br>
  14. Email: $email <br>
  15. EOD;
  16. $headers = "From: $email\r\n";
  17. $headers .= "Content-type: text/html\r\n";
  18. $success = mail($webMaster, $emailSubject, $body,
  19. $headers);
  20.     
  21. }
  22. /* Email Variables */
  23. $emailSubject = 'Event';
  24. $webMaster = 'emailaddress1';
  25. /* Data Variables */    
  26. $name = $_POST['Name'];
  27. $email = $_POST['Email'];
  28. $phone = $_POST['Phone_Number'];
  29. $company = $_POST['Company'];
  30. $address = $_POST['Address'];
  31. $city= $_POST['City'];
  32. $state = $_POST['State'];
  33. $zip = $_POST['Zip_Code'];
  34. $yes = $_POST['tickets'];
  35. if (flashseed($yes) == "Yes")
  36. $checkbox = $_POST['ckboxGrp1'];
  37. foreach ($checkbox as $chkbx)
  38. {
  39.     echo "$chkbx is checkeg\n";
  40. }
  41. $body = <<<EOD
  42. <br><hr><br>
  43. Company: $company <br>
  44. Name: $name <br>
  45. Email: $email <br>
  46. Phone: $phone <br>
  47. Address: $address<br>
  48. City: $city <br>
  49. State: $state <br>
  50. Postal Code: $zip <br>
  51. Tickets: $yes <br>
  52. Certification: $chkbx <br>
  53. EOD;
  54. $headers = "From: $email\r\n";
  55. $headers .= "Content-type: text/html\r\n";
  56. $success = mail($webMaster, $emailSubject, $body,
  57. $headers);
  58. /* Results rendered as HTML */
  59. $theResults = <<<EOD
  60. <html>
  61. <head>
  62. <title>sent message</title>
  63. <meta http-equiv="refresh" content="3;URL=index.html">
  64. <style type="text/css">
  65. <!--
  66. body {
  67. background-color: #244a30;
  68. font-family: Verdana, Arial, Helvetica, sans-serif;
  69. font-size: 20px;
  70. font-style: normal;
  71. line-height: normal;
  72. font-weight: normal;
  73. color: #fab323;
  74. text-decoration: none;
  75. padding-top: 200px;
  76. margin-left: 150px;
  77. width: 800px;
  78. }
  79. -->
  80. </style>
  81. </head>
  82. <blockquote><center>
  83. <div align="center">Registration Complete!<br>
  84. You will return to company in a few seconds !</div>
  85. </center></blockquote>
  86. </div>
  87. </body>
  88. </html>
  89. EOD;
  90. echo "$theResults";
  91. ?>


postonoh wrote:
I just added the following code
Code: [ Select ]
if (isset($_POST['ckboxGrp1']))
{
    $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
}
$chkbx = $_POST['ckboxGrp1'];
  1. if (isset($_POST['ckboxGrp1']))
  2. {
  3.     $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
  4. }
  5. $chkbx = $_POST['ckboxGrp1'];


now getting array instead of what has been check in with the check boxes.

  • postonoh
  • Newbie
  • Newbie
  • postonoh
  • Posts: 5

Post 3+ Months Ago

I am trying to create php script that when a persons has selected yes on the form for tickets
it emails name and email to emailaddress2 and email all the other information filled out on the form to emailaddress1

This is what is happening when a user select yes or no it is still emails the information listed in the function flashseed ()to emailaddress2

I need that if the say no not to call the function.

Also, I have four check boxes on the page I need to know the value of the checked boxes when I receive the emails when they register.

So one if person registers and select yes they need tickets. emailaddress2 should receive email with Name and email address. emailaddress1 should receive email with Company Name, Name, Address, City, State, Zip, tickets(yes or no), Check box value(Rock, Jazz, Classical, Soul).

I hope I am explaining this OK.

Code: [ Select ]
<?php
function flashseed()
{
    /* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress2';


/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$yes = $_POST['tickets'];

$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
    
}

/* Email Variables */

$emailSubject = 'Event';
$webMaster = 'emailaddress1';

/* Data Variables */    
$name = $_POST['Name'];
$email = $_POST['Email'];
$phone = $_POST['Phone_Number'];
$company = $_POST['Company'];
$address = $_POST['Address'];
$city= $_POST['City'];
$state = $_POST['State'];
$zip = $_POST['Zip_Code'];
$yes = $_POST['tickets'];
if (flashseed($yes) == "Yes")
$checkbox = $_POST['ckboxGrp1'];
foreach ($checkbox as $chkbx)
{
    echo "$chkbx is checkeg\n";
}

$body = <<<EOD
<br><hr><br>
Company: $company <br>
Name: $name <br>
Email: $email <br>
Phone: $phone <br>
Address: $address<br>
City: $city <br>
State: $state <br>
Postal Code: $zip <br>
Tickets: $yes <br>
Certification: $chkbx <br>

EOD;


$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);


/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=index.html">
<style type="text/css">
<!--
body {
background-color: #244a30;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fab323;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}

-->
</style>
</head>
<blockquote><center>
<div align="center">Registration Complete!<br>
You will return to company in a few seconds !</div>
</center></blockquote>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>
  1. <?php
  2. function flashseed()
  3. {
  4.     /* Email Variables */
  5. $emailSubject = 'Event';
  6. $webMaster = 'emailaddress2';
  7. /* Data Variables */    
  8. $name = $_POST['Name'];
  9. $email = $_POST['Email'];
  10. $yes = $_POST['tickets'];
  11. $body = <<<EOD
  12. <br><hr><br>
  13. Name: $name <br>
  14. Email: $email <br>
  15. EOD;
  16. $headers = "From: $email\r\n";
  17. $headers .= "Content-type: text/html\r\n";
  18. $success = mail($webMaster, $emailSubject, $body,
  19. $headers);
  20.     
  21. }
  22. /* Email Variables */
  23. $emailSubject = 'Event';
  24. $webMaster = 'emailaddress1';
  25. /* Data Variables */    
  26. $name = $_POST['Name'];
  27. $email = $_POST['Email'];
  28. $phone = $_POST['Phone_Number'];
  29. $company = $_POST['Company'];
  30. $address = $_POST['Address'];
  31. $city= $_POST['City'];
  32. $state = $_POST['State'];
  33. $zip = $_POST['Zip_Code'];
  34. $yes = $_POST['tickets'];
  35. if (flashseed($yes) == "Yes")
  36. $checkbox = $_POST['ckboxGrp1'];
  37. foreach ($checkbox as $chkbx)
  38. {
  39.     echo "$chkbx is checkeg\n";
  40. }
  41. $body = <<<EOD
  42. <br><hr><br>
  43. Company: $company <br>
  44. Name: $name <br>
  45. Email: $email <br>
  46. Phone: $phone <br>
  47. Address: $address<br>
  48. City: $city <br>
  49. State: $state <br>
  50. Postal Code: $zip <br>
  51. Tickets: $yes <br>
  52. Certification: $chkbx <br>
  53. EOD;
  54. $headers = "From: $email\r\n";
  55. $headers .= "Content-type: text/html\r\n";
  56. $success = mail($webMaster, $emailSubject, $body,
  57. $headers);
  58. /* Results rendered as HTML */
  59. $theResults = <<<EOD
  60. <html>
  61. <head>
  62. <title>sent message</title>
  63. <meta http-equiv="refresh" content="3;URL=index.html">
  64. <style type="text/css">
  65. <!--
  66. body {
  67. background-color: #244a30;
  68. font-family: Verdana, Arial, Helvetica, sans-serif;
  69. font-size: 20px;
  70. font-style: normal;
  71. line-height: normal;
  72. font-weight: normal;
  73. color: #fab323;
  74. text-decoration: none;
  75. padding-top: 200px;
  76. margin-left: 150px;
  77. width: 800px;
  78. }
  79. -->
  80. </style>
  81. </head>
  82. <blockquote><center>
  83. <div align="center">Registration Complete!<br>
  84. You will return to company in a few seconds !</div>
  85. </center></blockquote>
  86. </div>
  87. </body>
  88. </html>
  89. EOD;
  90. echo "$theResults";
  91. ?>


postonoh wrote:
I just added the following code
Code: [ Select ]
if (isset($_POST['ckboxGrp1']))
{
    $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
}
$chkbx = $_POST['ckboxGrp1'];
  1. if (isset($_POST['ckboxGrp1']))
  2. {
  3.     $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
  4. }
  5. $chkbx = $_POST['ckboxGrp1'];


now getting array instead of what has been check in with the check boxes.



postonoh wrote:
Code: [ Select ]
if (isset($_POST['ckboxGrp1']))
{
    $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
}
$chkbx = $_POST['ckboxGrp1'];
foreach ($checkbox as $chkbx)
{
    $checkbx .= "$chkbx\n";
}
  1. if (isset($_POST['ckboxGrp1']))
  2. {
  3.     $_POST['ckboxGrp1'] = implode(', ', $_POST['ckboxGrp1']);
  4. }
  5. $chkbx = $_POST['ckboxGrp1'];
  6. foreach ($checkbox as $chkbx)
  7. {
  8.     $checkbx .= "$chkbx\n";
  9. }

Now its working. Still have problem with if yes call function if no do call function

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 35 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.