Results 1 to 7 of 7
-
29th Sep 2012, 06:30 PM #1OPMemberWebsite's:
cb-gfx.com[PHP] Getting blank message from contact form
heyy
i m receiving blank message on my email from contact form of some site.
html content:
Code:<!-- contact form start --> <div class="contactForm" id="contactForm"> <form id="contact"> <fieldset> <label for="contactName" id="name_label">Name (required)</label> <input type="text" name="contactName" id="contactName" size="30" value="" class="text-input" /> <label for="contactEmail" id="email_label">Email (required)</label> <input type="text" name="contactEmail" id="contactEmail" size="30" value="" class="text-input" /> <label for="contactSubject" id="subject_label">Subject</label> <input type="text" name="contactSubject" id="contactSubject" size="30" value="" class="text-input" /> <label for="contactMessage" id="message_label">Message (required)</label> <textarea name="contactMessage" id="contactMessage" class="text-input"></textarea> <p> <input type="submit" name="submitMessage" class="contactButton" id="contactSubmitBtn" value=""/> </p> </fieldset> </form> </div> <!-- contact form end -->
mail.php content:
Code:<?php if (isset($_POST['email'])) //if "email" is filled out, send email { //send email $email = $_POST['email'] ; $name = $_POST['name'] ; $subject = $_POST['subject'] ; $contactMessage = $_POST['contactMessage'] ; $header = ''; $header .= "Reply-To: $name <$email>\r\n"; $header .= "Return-Path: $name <$email>\r\n"; $header .= "From: $name <admin@cb-gfx.com>\r\n"; $header .= "Organization: CB-Graphics\r\n"; $header .= "Content-Type: text/plain\r\n"; mail("divyap_31@yahoo.com", $subject, $contactMessage, $header); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> contactMessage:<br /> <textarea name='contactMessage' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; } ?>
Plz help me to fix this!
THanks!coolboyz2323 Reviewed by coolboyz2323 on . [PHP] Getting blank message from contact form heyy i m receiving blank message on my email from contact form of some site. html content: <!-- contact form start --> <div class="contactForm" id="contactForm"> <form id="contact"> <fieldset> Rating: 5
My KWWH Graphics Thread!
Respected - Hawk, Capone, Mindy, Humour, Sp32, Sushant, xTreme, Joomlaz, Pankaj, rko
-
29th Sep 2012, 06:32 PM #2Member
Did your setup your server for mail to work
You will need a mail cilentHelping people is my hobby.....
Learn how to secure your server against ddos
-
29th Sep 2012, 06:37 PM #3OPMemberWebsite's:
cb-gfx.com
My KWWH Graphics Thread!
Respected - Hawk, Capone, Mindy, Humour, Sp32, Sushant, xTreme, Joomlaz, Pankaj, rko
-
29th Sep 2012, 07:18 PM #4MemberPHP Code:
<?php
if (isset($_POST['contactEmail']))
{
$email = $_POST['contactEmail'] ;
$name = $_POST['contactName'] ;
$subject = $_POST['contactSubject'] ;
$contactMessage = $_POST['contactMessage'] ;
$header = "Reply-To: $name <$email>\r\n";
$header .= "Return-Path: $name <$email>\r\n";
$header .= "From: $name <admin@cb-gfx.com>\r\n";
$header .= "Organization: CB-Graphics\r\n";
$header .= "Content-Type: text/plain\r\n";
mail("divyap_31@yahoo.com", $subject, $contactMessage, $header);
echo "Thank you for using our mail form";
}
else
{
echo "<form method='post' action='mailform.php'>
Email: <input name='contactEmail' type='text' /><br />
Subject: <input name='contactSubject' type='text' /><br />
contactMessage:<br />
<textarea name='contactMessage' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
You should add form validation
-
29th Sep 2012, 07:22 PM #5OPMemberWebsite's:
cb-gfx.com
My KWWH Graphics Thread!
Respected - Hawk, Capone, Mindy, Humour, Sp32, Sushant, xTreme, Joomlaz, Pankaj, rko
-
29th Sep 2012, 07:34 PM #6Member
You should be able to to quite easy integrate recapcha . Check their wiki. On phone otherwise would do it for you
-
30th Sep 2012, 08:03 AM #7OPMemberWebsite's:
cb-gfx.com
My KWWH Graphics Thread!
Respected - Hawk, Capone, Mindy, Humour, Sp32, Sushant, xTreme, Joomlaz, Pankaj, rko
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Contact form in PHP website gives errors
By f4n3 in forum Web Development AreaReplies: 2Last Post: 3rd May 2012, 03:42 PM -
Where can I found a good contact form?
By Divvy in forum Webmaster DiscussionReplies: 9Last Post: 31st Mar 2011, 06:00 PM -
23:34 10/11/2010 - Contact form
By JmZ in forum Web Development AreaReplies: 4Last Post: 12th Nov 2010, 11:53 AM -
Free Contact Form Lite
By Jesse in forum Useful SitesReplies: 1Last Post: 30th Dec 2009, 08:50 PM -
Free Contact Form
By johnny in forum Webmaster DiscussionReplies: 1Last Post: 2nd Dec 2009, 03:35 PM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...