A
Anonymous
Guest
I have a contact form in my index.php as follows:
I'd like to merge my mail.php into it. My mail.php code is:
Is this possible? If so, where should it be inserted, before or after the closing of the form?
Thanks in advance,
Larry
Code:
<div "myform">
<br /><h1>Need help? Have a suggestion? Why not send us an email.</h1>
<h3><center>You'll receive a copy for your records</center></h3>
<br />
<form id="form1" action="mail.php" method="POST">
<label>Name</label>
<input type="text" name="name">
<label>Email</label>
<input type="text" name="email">
<select name="type" id="category" size="1" required>
<option>Select A Category</option>
<option>Questions</option>
<option>Report Problems</option>
<option>Suggestion</option>
<option>Other</option>
<option>Website Problem</option>
</select>
<br /><br /> <br />
<label>Message</label>
<textarea name="message" rows="7"></textarea><br />
<button type="submit" value="Send" style="margin-top:15px; margin-left: 500px; text-align: center;">Send Email</button>
<div class="spacer"></div>
<br /><br /><br /><br /><br /><br />
</form>
</div>
</div>
I'd like to merge my mail.php into it. My mail.php code is:
Code:
<?php
$subject = $_POST['type'];
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name\r\nEmail: $email\r\nMessage: $message";
if ($subject =="Website Problem") {
$recipient="webmaster@foxclone.com" ;
}
else{
$recipient="help@foxclone.com";
}
$mailheader = "From: $email\r\nBcc: $email\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank you for contacting us!" . " -" . "<a href='index.php#contact' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
Thanks in advance,
Larry