My New Mailer Script

Hi Everyone,

I have a form FYI that uses A Better Form - hides some tags apparently to help with spam. Anyway, the form doesn’t ask for an email of the submitter just sends to me (obscured in this example).
I’d appreciate it if you could review and let me know if I’ve goofed up anything - First time to write a mailer script.

You can see the form (timesheet form on the right) here: http://www.partiproductions.com/prochef1_test/index.php

[php]<?php
if($_POST):
$send_to = “bill@my_domain.com”;
$email = $_POST[‘email’];
$subject = $_POST[‘subj’];
$name = $_POST[‘name’];
$numplaces = $_POST[‘numplaces’];
$loc1 = $_POST[‘loc1’];
$dates1 = $_POST[‘date1’];
$days1 = $_POST[‘day1[]’];
$hours1 = $_POST[‘hours1’];
$loc2 = $_POST[‘loc2’];
$dates2 = $_POST[‘date2’];
$days2 = $_POST[‘day2[]’];
$hours2 = $_POST[‘hours2’];
$loc3 = $_POST[‘loc3’];
$dates3 = $_POST[‘date3’];
$days3 = $_POST[‘day3[]’];
$hours3 = $_POST[‘hours3’];
$tothours = $_POST[‘totalhrs’];
$affirm = $_POST[‘gen[]’];
mail($send_to, $subject, “Name: $name”, “Number of Places Worked: $numplaces”, “Location1: $loc1”, “Date(s): $dates1”, “Day(s): $days1”, “Hours at Location1: $hours1”, “Location2: $loc2”, “Date(s): $dates2”, “Day(s): $days2”, “Hours at Location2: $hours2”, “Location3: $loc3”, “Date(s): $dates3”, “Day(s): $days3”, “Hours at Location3: $hours3”, “Total Hours: $tothours”, “I Affirm: $affirm”, “From: $from\n” .“X-Mailer: PHP/” . phpversion()) OR die(“Error sending email!”);
echo “Your Time Sheet is Submitted !”;
endif;
?>[/php]

Thanks, Bill

Sponsor our Newsletter | Privacy Policy | Terms of Service