The Church Media Community
Equipping You to Communicate Effectively
support CMN & share a
library of 19K+ images, videos, etc
Go Pro!
 
Go Back   The Church Media Community > Website Design > Website Coding Discussions
Forgot Password?
                          Register

Website Coding Discussions PHP, MySQL, Java, Javascript, ASP, etc.

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old Wednesday, October 15th, 2008, 08:21 AM
Church Media Regular

 
 Join Date: Oct 2008 
 Last Online: Monday, June 6th, 2011 
Question Empty Contact Messages

I thought I fixed this problem with some scripts but I'm still getting empty contact messages. Can someone look at my code?

I added this to my contact page



----I also added a sendmail.php to stop the empty messages.----


$from_name = $_POST['name'];
$from_email = $_POST['email'];
$phone_number = $_POST['phone'];
$message = $_POST['message'];

$to_name = "Webmaster";
$to_email = "my email address";

$subject = "Website Contact Message Received";
$today = date("n/j/Y g:ia");
$ip_addr = $_SERVER['REMOTE_ADDR'];

$body = "Website Contact Message Received

-----------------------------------------

From: $from_name
E-mail: $from_email
Phone: $phone_number

Message:

$message

--------------------------------------------------------
Message received on $today from $ip_addr
";

mail($to_email, $subject, $message, "From: $from_email");


?>
Reply With Quote Start a New Topic From This Comment
  #2 (permalink)  
Old Wednesday, October 15th, 2008, 09:53 AM
Church Media Regular

 
 Join Date: Oct 2008 
 Last Online: Monday, June 6th, 2011 
Oops cut and paste code

The code didn't show on my first post. Not sure how to post code. I took out the <'s and the >'s around the script and the !--

Code:
 
  script type="text/javascript"
!--
function checkinput() {
var ret = false; // set to false unless the criteria is met
if (document.formname.name.value == "") {
alert("Please enter your name before submitting the form. Thanks.");
} else if (document.formname.message.value == "") {
alert("Please enter a message before submitting the form. Thanks.");
} else {
ret = true; // message and from_name are not blank, continue with submit
}
return ret;
} // end function checkinput
//--
  /script
Reply With Quote Start a New Topic From This Comment
Reply

  The Church Media Community > Website Design > Website Coding Discussions

Tags
contact, empty, message, php, spam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:



Add to Google


Register Now for FREE!
Our records show you have not yet registered to our community. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:
Agree to forum rules 


All times are GMT -6. The time now is 01:04 PM.

   
 
© 1995-2008, ChurchMedia™, ChurchMedia LLC

SEO by vBSEO 3.1.0