function valid_email($address)
{
// check an email address is possibly valid
if (ereg('^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $address))
return true;
else
return false;
}
if($_REQUEST['action']=='send')
{
$name=$_REQUEST['name'];
$address=$_REQUEST['address'];
$city=$_REQUEST['city'];
$state=$_REQUEST['state'];
$zip=$_REQUEST['zip'];
$phone1=$_REQUEST['phone1'];
$phone2=$_REQUEST['phone2'];
$phone3=$_REQUEST['phone3'];
$email=$_REQUEST['email'];
$radiobutton=$_REQUEST['radiobutton'];
$needs=$_REQUEST['needs'];
$To="jnixon@illuscience.com";
$Subject="Illuscience.com Contact Us";
$From=$email;
if($_REQUEST['radiobutton']=='phoneradio')
{
if($phone1=='' && $phone2=='' || $phone3=='')
{
$msg='Please enter a valid phone number.';
}
else
{
$phonecheck=1;
}
$bestway='Phone';
}
if($_REQUEST['radiobutton']=='email')
{
$check=valid_email($email);
if($check==false)
{
$msg.="
Please enter a valid email address.";
}
$bestway='Email';
}
$Message="Best Way to Contact : ".$bestway.'
';
$Message.="Name : ".$name.'
';
$Message.="Address : ".$address.'
';
$Message.="City : ".$city.'
';
$Message.="State : ".$state.'
';
$Message.="Zip : ".$zip.'
';
if($phone)
{
$Message.="Phone : ".$phone1.$phone2.$phone3.'
';
}
if($email)
{
$Message.="Email : ".$email.'
';
}
$Message.="Comments : ".$needs.'
';
if($check==true || $phonecheck==1)
{
//print $Message;
//exit;
mail($To,$Subject,$Message,"From: $Name <$From> \nReply-To:<".$From."> \nContent-Type: text/html; charset=iso-8859-1");
$msg.='Your contact information has been sent successfully';
}
}
?>
|
|||||||||
|
|||||||||
|