All pastes #261392 Raw Edit

Miscellany

public php v1 · immutable
#261392 ·published 2006-11-29 05:18 UTC
rendered paste body
<p><center><?phpif (isset($submit)) {$name = $_POST['name'];   // 'name' field$email = $_POST['email'];  // 'email' field$find = $_POST['find'];   // 'found out about' field$message = $_POST['message']; // 'message' fieldif (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 = "admin@pestirc.com";  // Email address its going to$subject = "Question from a user"; // Subject field$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 PestIrc.Com - We will shortly <br />";echo "reply to your message.";} else foreach ($error as $msg) echo $msg.'<br />';} else {?>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>";}?>