Reply
Contact me results returning blank emails
Old 10-21-2009, 12:16 AM Contact me results returning blank emails
TheDon's Avatar
Average Talker

Posts: 27
Name: Don
Trades: 0
Hi all,
I have set up a contact form and 8 out of 10 come back blank. When I test it it comes back fine, but for some reason every few days I get emailed a blank form from my contact us.
Can someone please look at my following send file code to see if I have done anything wrong.
Thanks

PHP Code:
<?php
//--------------------------Set these paramaters--------------------------[/FONT]
[FONT=Calibri]// Subject of email sent to you.
$subject 'Results from Contact form'; [/FONT]
[
FONT=Calibri]// Your email address. This is where the form information will be sent. 
$emailadd = [EMAIL="'admin@thai-discovery.com'"]'admin@thai-discovery.com'[/EMAIL]; [/FONT]
[
FONT=Calibri]// Where to redirect after form is processed. 
$url 'http://www.thai-discovery.com'; [/FONT]
[
FONT=Calibri]// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req '0'; [/FONT]
[
FONT=Calibri]// --------------------------Do not edit below this line--------------------------
$text "Results from form:\n\n"
$space ' ';
$line '
'
;
foreach (
$_POST as $key => $value)
{
if (
$req == '1')
{
if (
$value == '')
{echo 
"$key is empty";die;}
}
$j strlen($key);
if (
$j >= 20)
{echo 
"Name of form element $key cannot be longer than 20 characters";die;}
$j 20 $j;
for (
$i 1$i <= $j$i++)
{
$space .= ' ';}
$value str_replace('\n'"$line"$value);
$conc "{$key}:$space{$value}$line";
$text .= $conc;
$space ' ';
}
mail($emailadd$subject$text'From: '.$emailadd.'');
echo 
'<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

Last edited by chrishirst; 10-21-2009 at 07:44 AM..
TheDon is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 10-21-2009, 12:21 AM Re: Contact me results returning blank emails
Clarence_82's Avatar
Skilled Talker

Posts: 85
Name: Clarence
Trades: 0
Are you sure it's not just bots or people hitting submit on your form without entering anything. That will happen all the time if you don't have the capta. Have you ever received a blank form when you tested it?
__________________
-Clarence Cowan

Texas Web Design
Clarence_82 is offline
Reply With Quote
View Public Profile
 
Old 10-21-2009, 01:16 AM Re: Contact me results returning blank emails
TheDon's Avatar
Average Talker

Posts: 27
Name: Don
Trades: 0
This is my contact page http://www.thai-discovery.com/Contactus.html
If you just hit submit without putting you name or email, it wont let you submit it. So spam and Bots won't be able to sumbit blank emails.

And yes, everytime I have tested it, I do get what I put in there 100% of the time.

So I am assuming it must be in my source code or something else must be the problem.
TheDon is offline
Reply With Quote
View Public Profile
 
Old 10-21-2009, 07:45 AM Re: Contact me results returning blank emails
chrishirst's Avatar
Super Moderator

Posts: 22,260
Location: Blackpool. UK
Trades: 0
Use code delimiters please http://www.webmaster-talk.com/php-fo...st-my-php.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-21-2009, 07:48 AM Re: Contact me results returning blank emails
chrishirst's Avatar
Super Moderator

Posts: 22,260
Location: Blackpool. UK
Trades: 0
Quote:
And yes, everytime I have tested it, I do get what I put in there 100% of the time.

So I am assuming it must be in my source code or something else must be the problem.
IF it works 100% when YOU use the form HOW can it be the source code?????
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Contact me results returning blank emails
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.14701 seconds with 13 queries