<?php

function removeHTML($texttovalid){
		$texttovalid = trim($texttovalid);
		if(strlen($texttovalid)>0){
			$texttovalid = htmlspecialchars(stripslashes($texttovalid));
		}
		return $texttovalid;
}

if(isset($_POST['submit'])){

	$name = removeHTML($_POST['name']);
	$email = removeHTML($_POST['email']);
	$telephone = removeHTML($_POST['telephone']);
	$message = removeHTML($_POST['message']);
	$msg ='';
	
	if($name==''){
		$msg = '<li>Name is a required field.</li>';
	}
	if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)){
	   $msg .= '<li>Invalid Email Address</li>';
	}
	if($telephone==''){
		$msg .= '<li>telephone is a required field.</li>';
	}
	if($message==''){
		$msg .= '<li>Message is a required field.</li>';
	}
	
	if($msg!=''){
		$msg = '<div class="errorMsg"><h3>Message Field!</h3><br /><ul>' . $msg . '</ul></div>';
	}
	else{
		
		
		$to = "anuj1234@gmail.com";
		
		
		$headers = "From: $email";
		$subject = "A message from a site visitor";
		$body = "Name: $name\n\n"
			. "Email: $email\n\n"
			. "telephone: $telephone\n\n"
			. "Message: $message"
			;
		$ok = (mail($to, $subject, $body, $headers));
		
		if($ok){
		$msg = '<div class="infoMsg"><h3>Message Sent!</h3><br /><p>Thank you for contacting us. We will get back to you shortly!</p></div>';
		}else{
		$msg = '<div class="errorMsg"><h3>Message Field!</h3><br /><p>Please try again.</p></div>';
		}
		
		
	}
	
}
?>
Rainbow Greeners
 

 

Contact Us

 

Rainbow Greeners

Address: AS 101, Ujwal flats , rahate colony , wardha road, Nagpur (M.S)

Contact : +919823058195 - +919823190361

Email : info@rainbowgreeners.com, rainbowgreeners@hotmail.com

 

                      

                        

              

                

                                                       

 

Project 1

 

Rainbow Greeners, work at .............

 

Project 2

 

Rainbow Greeners, work at ..............