PDA

View Full Version : PHP Form's working fine but...


fluffykat
02-02-2011, 02:14 PM
Everything's working great on my forms. When I try to send it with any info omitted it will give me an error and not send it. However, the most frustrating thing. . . I get blank emails every morning at the same time. Completely blank, but from the forms. Any advice is greatly appreciated.

edbr
02-03-2011, 01:15 AM
postthe code for your mail handling script

fluffykat
02-03-2011, 07:10 AM
<?php
$subject="Prayer Request Form";
$emailadd="xxx@xxx.xxx";
$url="http://wwww.xxxxx.xxx/confpr.html";
$req="1";
$text = "Results from Prayer Request 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.'">';
?>

edbr
02-03-2011, 08:20 AM
no problem with formhandler

fluffykat
02-03-2011, 08:22 AM
Do you have any idea what is causing the blank emails each morning? Or how can I stop them?

Thanks!