Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-01-2012, 07:30 AM   PM User | #1
demostrates
New to the CF scene

 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
demostrates is an unknown quantity at this point
Problem contact form will not send email

Hi, i am new to coding, and i have a bit of a problem with the contact form on my website.

i have designed and coded my site by my self with tutorials and basic html and css i have learned.

my site is is here
the code for the contact page is:
i would really appreciate if you could help with this problem.
thanks in advance.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>  
  
    <link href="css/stylesheet.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" />  

<link href='http://fonts.googleapis.com/css?family=Exo:400,200' rel='stylesheet' type='text/css'>  
<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script>  
<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>  
<script src="js/animated-menu.js" type="text/javascript"></script>   


<script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="js/jquery.validationEngine.js" type="text/javascript"></script>

		<script>
		$(document).ready(function() {
			
			
			
			// SUCCESS AJAX CALL, replace "success: false," by:     success : function() { callSuccessFunction() }, 
			$("#form1").validationEngine({
				ajaxSubmit: true,
					ajaxSubmitFile: "ajaxSubmit.php",
					ajaxSubmitMessage: "Thank you, We will contact you soon !",
				success :  false,
				failure : function() {}
			})
			

		
		});
 
		
		</script>
        
        
        
        
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Con's Folio | Get in touch</title>

<style type="text/css">
<!--
body {
	background-color: white;
}

-->
</style></head>

<body>
<div id="index-container">
<div id="banner"></div>
  <div id="menu">
    <ul>
      <li class="green">
        <p><a href="index.html">Home</a></p>
        <p class="subtext">The front page</p>
      </li>
      <li class="yellow">
        <p><a href="about.html">Blog</a></p>
        <p class="subtext">More info</p>
      </li>
      <li class="red">
        <p><a href="folio.html">Folio</a></p>
        <p class="subtext">Examples of work</p>
      </li>
      <li class="blue">
        <p><a href="contact.html">Contact</a></p>
        <p class="subtext">Get in touch</p>
      </li>
    </ul>
  </div>
  <div id="filler-contact"></div>
<div id="contact-form">
<form>
<p class="name">
    <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input" id="name" value="" />
        <label for="name">Name</label>
  </p>
      <p class="email">
        <input name="email" type="text" class="validate[required,custom[email]] text-input" id="email" value="" />
        <label for="email">E-mail</label>
      </p>
      <p class="web">
        <input type="text" name="web" id="web" />
        <label for="web">Website</label>
      </p>
  <p class="text">
        <textarea name="text" class="validate[required,length[3,300]] text-input" id="text"></textarea>
      </p>
      <p class="text">
        <input type="submit" id="Send" value="Send"/>
 	</p>
    </form>
</body>
</html>
this is the php code i have to send the email.

PHP Code:
<?php

$name 
$_POST['name']; // contain name of person
$email $_POST['email']; // Email address of sender 
$web $_POST['web']; // Your website URL
$comment $_POST['text']; // Your message 
$receiver "myemail@gmail.com" // hardcorde your email address here - This is the email address that all your feedbacks will be sent to 
if (!empty($name) & !empty($email) && !empty($comment)) {
    
$body "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$comment}";
    
$send mail($receiver'Contact Form Submission'$comment"From: {$email}");
    if (
$send) {
        echo 
'true'//if everything is ok,always return true , else ajax submission won't work
    
}

}

?>

Last edited by demostrates; 04-01-2012 at 07:35 AM..
demostrates is offline   Reply With Quote
Old 04-01-2012, 07:55 AM   PM User | #2
Mishu
Banned

 
Join Date: Mar 2012
Posts: 306
Thanks: 1
Thanked 28 Times in 28 Posts
Mishu can only hope to improve
For one thing, php mail() requires smtp to be enabled on your ISP account otherwise it will not work.

If smtp is enabled, then what eror messages are you getting?
Mishu is offline   Reply With Quote
Old 04-01-2012, 08:08 AM   PM User | #3
demostrates
New to the CF scene

 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
demostrates is an unknown quantity at this point
There is no error message. the page reloads and the information i have entered shows in the address bar.
so do i have to enable smtp on my email provider? (gmail)
demostrates is offline   Reply With Quote
Old 04-01-2012, 10:43 AM   PM User | #4
demostrates
New to the CF scene

 
Join Date: Apr 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
demostrates is an unknown quantity at this point
I have solved the problem. thanks.
demostrates is offline   Reply With Quote
Reply

Bookmarks

Tags
coding, contact form, php, problem

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.