I am very new to this forum and in desperate need of HELP! Please someone help! I have a code to allow users to become fans of a business. When they click the submit button I want the info inserted in the database and an email sent to the business saying that they have a fan. The problem is when I added the code
Code: Select all
if (isset($_POST['yourfan']))Code: Select all
<form action="<?php echo $editFormAction; ?>" method="POST" name="fan" id="fan">
<input name="yourfan" type="image" value="Submit" onClick="<?php
if (isset($_POST['yourfan']))
{
$to = $row_Bus['Email'];
$subject = 'You Have A Fan !';
$body = "blah...blah...blah.... ";
$headers = "From: admin@mysite.com\r\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
$mail_sent = @mail( $to, $subject, $body, $headers );
}
?>;MM_popupMsg('It\'s official! You are now a fan.')" src="/FANBUT2.png" alt="Become A Fan"/>
</label>
<input type="hidden" name="MM_insert" value="fan" />
</form>