<?php if(isset($_POST['inputName3']) && isset($_POST['inputEmail3']) && isset($_POST['inputSite3']) && isset($_POST['inputMessage3'])) { $inputName3 = $_POST['inputName3']; $inputEmail3 = $_POST['inputEmail3']; $inputSite3 = $_POST['inputSite3']; $inputMessage3 = $_POST['inputMessage3']; if(!empty($inputName3) && !empty($inputEmail3) &&!empty($inputSite3) &&!empty($inputMessage3) ) { if(strlen($inputName3)>25 || strlen($inputEmail3)>50 || strlen($inputSite3)>30 || strlen($inputMessage3)>1000){ echo 'Sorry, maxlength for some field has been exceeded'; }else{ $to = 'ahammad559@gmail.com'; $subject = 'This is an email'; $body = $inputName3."\n\n".$inputMessage3 ; $headers = 'From : "php academy" <ahammad559@gmail.com>'; if(@mail($to, $subject, $body, $headers)){ echo 'Thanks for contacting us.we\'ll be touch in soon.'; }else{ echo 'Sorry, an error occurred.Please try again'; } } } else{ echo'all fields are required'; } } ?>
if(isset($_POST['inputName3']) && isset($_POST['inputEmail3']) && isset($_POST['inputSite3']) && isset($_POST['inputMessage3']))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)