I'm sure there is a simple fix to this, but I can't seem to work it out, I would like to use an image for the "Submit Button" however when I put the <input type="image" src="button.gif"> code in it returns the error in the code.
Here's the form:
<form method="POST" action="mailer.php">
Your Name:
<input type="text" name="name" size="19">
Date:
<input type="text" name="date" size="19">
Reason:<br>
<textarea rows="4" name="message" cols="35"></textarea>
<br>
<input type="image" src="images/button.gif" name="image">
</form>
And here's the code:
<?php
if(isset($_POST['submit'])) {
$to = "myemail@email.com";
$subject = "Day Off Request";
$name_field = $_POST['name'];
$date_field = $_POST['date'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "$name_field\n is requesting $date_field\n off for $message\n";
$success = mail($to, $subject, $body);
}
if ($success){
header("location: http://www.mydomain.com/thanks.php");
} else {
echo "Sorry error please try again...";
}
?>