I have a Form from where user Will put the Name, Message and his mail Id. And The details will be mailed to specified Mail BOX. Now I Need to put a image instead of a Submit Button. If i put the Submit Button the Mail Easily Delivered to me. If i put the Image then its not delivering.. please help me what to do??
[CODE]
<?php
$error = “”;
$success = FALSE;
if(isset($_POST[‘submit’]))
{
foreach($_POST as $key => $val)
{
if(empty($_POST[$key]))
{
$error .= “You must enter a value for ” .
ucwords(str_replace(“_”,” “,$key)) . “. “;
}
else
{
if(get_magic_quotes_gpc())
{
$_POST[$key] = stripslashes($val);
}
}
if($key != ‘enquiry’)
{
$_POST[$key] = preg_replace(‘/[rn]/’, ‘ ‘, $val);
}
}
if($_POST[’email’] == 0)
{
//$error .= “‘{$_POST[’email’]}’ does not appear to be a valid email address. “;
}
$to = “xxx@***.com”;
$headers = “MIME-Version: 1.0rn”;
$headers .= “Content-type: text/html; charset=iso-8859-1rn”;
$headers .= “From: “.$_POST[’email’].”rn”;
$mail = @mail($to,$_POST[‘name’],$_POST[‘enquiry’],$headers);
if(!$mail)
{
$error .= “There was an unknown error occurred “;
}
else
{
$error .= “Your message has been successfully sent. “;
}
}
?>
<form name=”ContactUs” method=”post” action=”../index.php?main_page=contact_us&action=success”>
<table width=”100%” border=”0″ cellspacing=”2″ cellpadding=”2″ >
<tr>
<td class=”plainBoxHeading” colspan=”2″>NAME</td>
</tr>
<tr>
<td class=”main” colspan=”2″><input name=”name” type=”text”></td>
</tr>
<tr>
<td class=”plainBoxHeading” colspan=”2″>EMAIL</td>
</tr>
<tr>
<td class=”main” colspan=”2″><input name=”email” type=”text” size=”50″></td>
</tr>
<tr>
<td class=”plainBoxHeading” colspan=”2″>Message</td>
</tr>
<tr>
<td class=”main” colspan=”2″><textarea name=”enquiry” cols=”50″ rows=”15″></textarea></td>
</tr>
<tr>
<td align=”right” class=”main”><a href =” javascript : submitForm(); “><img src=”../includes/templates/template_default/buttons/english/button_send.gif” alt=”send now”></a></td>
</tr>
</table>
</form>
<script language = “javascript”>
function submitForm() {
document.ContactUs.submit();
}
</script>