<div style='background-color: none transparent;'></div>
Home » » Sending Email with checkbox list in php

Sending Email with checkbox list in php




How is your weather now?


Please enter your information:



City:
Month:
Year:


Please choose the kinds of weather you experienced from the list below.

Choose all that apply.



Sunshine

Clouds

Rain

Hail

Sleet

Snow

Wind

Cold

Heat

Fog

Humidity


Anything Else? Please list in the additional weather conditions in box, separated by commas.












and here is the email coding:

if(isset($_POST['email'])) {

$email_to = "youremail@gmail.com";
$email_subject = "

How is your weather now

";

$city = $_POST['city'];
$month = $_POST['month'];
$year = $_POST['year'];
$type = $_POST['type'];
$add = $_POST['add'];

$email_message .= "In ".clean_string($city) . " in the month of " .clean_string($month).clean_string($year)." you observed the following weather: ""\n";

$check =0;
$top = array('Sunshine', 'Clouds', 'Rain', 'Hail', 'Sleet', 'Snow', 'Wind', 'Cold', 'Heat', 'Fog', 'Humidity');

foreach ($_POST['type'] as $type){
echo "
  • $type
  • \r\n";
    }

    ?>

    // create email headers
    $headers = 'From: '.$email_from."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers);
    ?>



    Thank you for contacting us. We will be in touch with you very soon.

    }
    ?>
    Share this article :
     
    Copyright © 2011. B.Sc B.Tech MCA Ploytechnic Mini,Main Projects | Free Main Projcets Download | MCA |B.tech . All Rights Reserved
    Company Info | Contact Us | Privacy policy | Term of use | Widget | Advertise with Us | Site map
    Template Modify by Creating Website. Inpire by Darkmatter Rockettheme Proudly powered by Blogger