Quantcast
Channel: Internet Explorer 8, 9, 10, 11 forum
Viewing all articles
Browse latest Browse all 10469

Contact form not working!! Help

$
0
0

Hi,

I am working on a contact for but it is not working properly, I don't know why. 

See this

You see, before i typed it showing me 'Contact form submitted!'. How can I fix this problem ????

My codes:

<div id="content"><div class="bot-1"><div class="zerogrid"><div class="col-full"><div class="wrap-col"><h2 class="indent-2">ConTact Us</h2></div></div><div class="col-1-2"><div class="wrap-col"><form id="text"><div class="text-info">Send an e-mail. All fields with an * are required</div><div class="success">Contact form submitted!<br><strong>We will be in touch soon.</strong> </div><fieldset><label class="name"><span class="title">Name*</span><input type="text" value=" "><br class="clear"><span class="error error-empty">*This is not a valid name.</span><span class="empty error-empty">*This field is required.</span></label><label class="email"><span class="title">E-mail*</span><input type="text" value=" "><br class="clear"><span class="error error-empty">*This is not a valid email address.</span><span class="empty error-empty">*This field is required.</span></label><label class="phone"><span class="title">Phone*</span><input type="tel" value=" "><br class="clear"><span class="error error-empty">*This is not a valid phone number.</span><span class="empty error-empty">*This field is required.</span></label><label class="message"><span class="title">Message*</span><textarea> </textarea><br class="clear"><span class="error">*The message is too short.</span> <span class="empty">*This field is required.</span></label><div class="clear"></div><a data-type="submit" class="btn">Send</a></fieldset></form></div></div>

Mailhander.php -

<?php
	$owner_email = $_POST["owner_email"];
	$headers = 'From:' . $_POST["email"];
	$subject = 'A message from your site visitor ' . $_POST["name"];
	$messageBody = "";
	if($_POST['name']!='nope'){
		$messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
		$messageBody .= '<br>' . "\n";
	}
	if($_POST['email']!='nope'){
		$messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
		$messageBody .= '<br>' . "\n";
	}else{
		$headers = '';
	}
	if($_POST['state']!='nope'){		
		$messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
		$messageBody .= '<br>' . "\n";
	}
	if($_POST['phone']!='nope'){		
		$messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
		$messageBody .= '<br>' . "\n";
	}	
	if($_POST['fax']!='nope'){		
		$messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
		$messageBody .= '<br>' . "\n";
	}
	if($_POST['message']!='nope'){
		$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
	}
	if($_POST["stripHTML"] == 'true'){
		$messageBody = strip_tags($messageBody);
	}
	try{
		if(!mail($owner_email, $subject, $messageBody, $headers)){
			throw new Exception('mail failed');
		}else{
			echo 'mail sent';
		}
	}catch(Exception $e){
		echo $e->getMessage() ."\n";
	}
?>

Anyone help me fast!!! I need it very soon. Its about my business.........


Viewing all articles
Browse latest Browse all 10469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>