All pastes #113534 Raw Edit

coldsteal

public php v1 · immutable
·published 2006-08-03 17:14 UTC
rendered paste body
<?phpfunction is_email_type($email) {	$email_types = array('gmail', 'yahoo', 'hotmail');	foreach ($email_types as $type) 	{	    if (strpos($email, '@'.$type) !== false)	        return true;	}	return false;}if($_POST['button']){	if($_POST['subject'] && $_POST['message'])	{		if(is_email_type($_POST['email']))		{			$email = $_POST['email'];			$toemail = "antonnid@gmail.com";			$subject = $_POST['subject'];			$message = $_POST['message'];			if(mail($toemail, $subject, $message, "From: $email"))				echo "<h3><font color=red>Your message has been sent. I will reply as soon as possible. I appreciate your suggestions and will take them into consideration.</font></h3>";			else				echo "Error sending email!";		}		else			echo "<h1><font color=red>Invalid Email Address</font></h1>";	}	else		echo "<h1><font color=red>One or more of the required fields was not filled out!</font></h1>";}?> <html><head><link rel="stylesheet" type="text/css" href="/itrash.css"></head><body id="body"><div id="border"><?echo get_include_path();?><form method="post">   <p align="center"><b>Contact Me</b></p>    <table border="1" cellspacing="0" align="center">        <tr>        <td>From:</td>        <td><input type="text" name="email"></td>    </tr>    <tr>        <td>Subject:</td>        <td><input type="text" name="subject"></td>    </tr>    <tr>        <td>Message:</td>        <td><textarea rows="5" name="message" maxlength="500"></textarea></td>    </tr>    </table>    <p align="center">    <input type="submit" name="button" />  <p align="center">  </p>  <p align="center"><a href="/source/contact_me_source.php"><b>source code</b></a> </p></form><!--<p align="center">From:    <input type="text" name="femail">    Subject:    <input type="text" name="subject">    Message:    <input type="text" name="message"> !-->  </div></body></html>