Hi everyone,
I am at my wits end with this. I am trying to set up a where my employees can simply fill out a form and have their time card fixes emailed to me instead of having a bunch of scraps of paper floating around my desk. Here is the code I have for the php:
PHP Code:
<?php if(isset($_POST['submit'])) {
$to = "fake@email"; $subject = "Attendance Correction Form"; $name_field = $_POST['name']; $todays_date = $_POST['tDate']; $date_correction = $_POST['datecorrection']; $time_in = $_POST['timein']; $lunch_out = $_POST['lunchout']; $lunch_in = $_POST['lunchin']; $time_out = $_POST['timeout']; $body = "From: $name_field\n Today's Date: $todays_date\n Date Needing Correction: $date_correction\n Time In: $time_in\n Lunch Out: $lunch_out\n Lunch In: $lunch_in\n Time Out: $time_out"; echo "Thank you. Your form has been submitted."; mail($to, $subject, $body);
} else {
echo "ERROR!";
} ?>
and the html:
HTML Code:
<form method="POST" action="acf.php">
<p>Name<br />
<input type="text" name="name" id="name" class="style"/>
<br />
<br />
Today's Date<br />
<input type="text" name="tDate" id="tDate" class="style" />
<br />
<br />
Date Needing Correction<br />
<input type="text" name="datecorrection" id="datecorrection" class="style"/>
<br />
<br />
Time In<br />
<input type="text" name="timein" id="timein" class="style"/>
<br />
<br />
Lunch Out<br />
<input type="text" name="lunchout" id="lunchout" class="style"/>
<br />
<br />
Lunch In<br />
<input type="text" name="lunchin" id="lunchin" class="style"/>
<br />
<br />
Time Out<br />
<input type="text" name="timeout" id="timeout" class="style"/>
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
When I hit the submit button, I don't get any error messages from the script, just the "ERROR!"
Please help! Thank you ahead of time.
Last edited by werm82; 09-30-2008 at 07:39 PM..
|