Jump to content

How do I use print isset on this from?


frank_solo

Recommended Posts

How do I print isset on this form? Thanks

<?php $var = $result['email'];
if (!empty($var)) {

if (isset($_POST['submit'])) {	

if(isset($_POST['answer']) && $_POST['answer'] == '2'){
$to       = "$var"; // change to your email address
$name     = htmlspecialchars ($_POST['name']);
$email    = htmlspecialchars ($_POST['email']);
$phone    = htmlspecialchars ($_POST['phone']);
$msg      = htmlspecialchars ($_POST['msg']);
$d        = date('l dS \of F Y h:i:s A');
$sub      = "My Domain RE:".$result['title']."";
$headers  = "From: $name <$email>\n";  
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
$mes      = "phone: ".$phone."\n";
$mes     .= "Message: ".$msg."\n";
$mes     .= "Name: ".$name."\n";
$mes     .= 'Email: '.$email."\n";
$mes     .= 'Date & Time: '.$d;
mail($to, $sub, $mes, $headers);

echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>Email Has Been Sent</span></div>";
} else {

echo "<div align='center'<span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #F00;'>ANSWER does not match! </span></div>";

}

} 
echo "<div align='center'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 14px; color: #00F;'>Email: ".$result['contact']."</span></div>
<form method='post' action='apt.php?id=$id' name='contact' onSubmit='return Blank_TextField_Validator()'>
<input name='name' type='text' size='40' placeholder='Name' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['name'])."'/><br>
<input name='email' type='text' size='40' placeholder='Email' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['email'])."'/><br>
<input name='phone' type='text' size='40' placeholder='Phone' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['phone'])."'/><br>
<textarea name='msg' cols='29' rows='4' value='".preg_replace('/[^a-z\-_0-9\.:\/]/i','',$_POST['msg'])."' id='msg'></textarea><br>
<div align='left'><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>What is 2 + 2? </span><br><span style='font-family: Tahoma, Geneva, sans-serif; font-size: 12px; color: #000;'>Answer: </span><input name='answer' type='text' id='answer' size='3' maxlength='3' /><input type='submit' class='button4' value='Send' name='submit' /></div>
</form><br><br><br>";}?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.