Hello all I have worked up this php from from diff samples off the internet.
Not sure about one of the functions. could I please get some advice?
<form name="dp01" method="post" action="sendDropBox.php">
<fieldset>
<input name="title" type="text" class="generic">
<legend>what type of box would you like?</legend>
<input name="subject" type="text" id="subject" size="50">
<legend>Details and information</legend>
<textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>
<legend>Your Name</legend>
<input name="name" type="text" id="name" size="50">
<p> </p>
<legend>Your Email</legend>
<input name="customer_mail" type="text" id="customer_mail" size="50"></td>
<p> </p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</fieldset>
</form>
<?php
// Contact subject
$subject ="$subject";
// Details
$message="$detail";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ='theEmail@gmail.com';
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// We've received your request and will soon be in touch."
if($send_contact){
if(isset($_POST['subject'],$_POST['detail'], $_POST['name'], $_POST['customer_mail'])){
if(isset($_POST['title']) && !empty($_POST['title'])){
die();
}
echo "We've received your request and will soon be in touch.";
}else {
echo "ERROR";
}
}
?>
my thing is this…I do not see how the submit button is connected to the action of
$send_contact
I also tried to add the
isset
component but was then wondering if I added correctly the
if($send_contact)
at the top.
& the .generic is to create a hidden input field as an added bot prevention.
Thank you
dlm