<?php
$address = $_SERVER['remote_addr'];
?>
<?php
$name = addslashes($_GET['name']);
$email = addslashes($_GET['email']);
$msg = addslashes($_GET['msg']);
?>
<?php
$header = "From: $email";
$subject = "My contact Form";
$mymail = "youremail@yoursite.com"; //Put your email address here
$smsg = "Visitor's IP: $address\n"
. "name: $name\n"
. "email: $email\n"
. "msg: $msg\n";
?>
<?php
mail ($mymail,$subject,$smsg,$header);
?>
<?php
if (strlen($name) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid name</font></p>");
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}
if (strlen($email) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}
if (strlen($msg) <5)
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
if (strlen($msg) >500)
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
if (strlen($msg) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
?>
<?php
<?
// script made by chronocalamity under the law "wtf u want with it but give me my props"
// Vars
$address = $_SERVER['REMOTE_ADDR'];
$name = addslashes($_GET['name']);
$email = addslashes($_GET['email']);
$msg = addslashes($_GET['msg']);
// Validation
if (strlen($name) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid name</font></p>");
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}
if (strlen($email) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid email</font></p>");
}
if (strlen($msg) <5)
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
if (strlen($msg) >500)
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
if (strlen($msg) == 0 )
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid msg</font></p>");
}
// sending the mail
$header = "From: $email";
$subject = "Test contact Form";
$mymail = "youremail@yoursite.com";
$smsg = "Visitor's IP: $address\n"
. "name: $name\n"
. "email: $email\n"
. "msg: $msg\n";
mail ($mymail,$subject,$smsg,$header);
?>
?>