All pastes #552310 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-09 06:57 UTC
rendered paste body
<?php

if (isset($submit)) {

$name = $_POST['name'];   
$email = $_POST['email'];  
$find = $_POST['find'];  
$message = $_POST['message']; 


if (empty($name)) $error[]="You did not fill out your name, please go back and correct this!";
if (empty($email)) $error[]="You did not fill out your valid email address, please go back and correct this!";
if (empty($message)) $error[]="You did not fill out your message, please go back and correct this!";



if (isset($error)==false) {
 $to = "your@email";  
$subject = "Question from a user"; 
$msg = "Name: $name\nEmail: $email\nSubject: $find\n\nMessage:\n $message"; 
 

mail($to,$subject,$msg, "From: $email");
echo "<br><p><br>";
echo "Thank you for contacting me - We will shortly <br />";
echo "reply to your message.";

} else foreach ($error as $msg) echo $msg.'<br />';

} else {

echo "Have a question about the site or staff? Ask away and get a reponse soon. <br><b>Note: For our staff to reply to your questions, you need to enter a valid email address.</b><p>";

echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<p>Your name:";
echo "&nbsp;<input type=\"text\" name=\"name\" size=\"40\" />";

echo "<p>Your e-Mail:";
echo "&nbsp;<input type=\"text\" name=\"email\" size=\"40\" />";

echo "<p>Subject of question:";
echo "&nbsp;<input type=\"text\" name=\"find\" size=\"40\" />";

echo "<p>Your message: <br /> </p>";
echo "<p><textarea cols=\"50\" rows=\"10\" name=\"message\"></textarea></p>";

echo "<p><input type=\"submit\" name=\"submit\" value=\"Submit\" />";
echo "</form>";
}
?>