PDA

View Full Version : such a dumb question... I hate to ask, but form isn't working right...


carolinawebdesign
08-16-2007, 04:52 AM
Here is the site with the form: http://www.russodumpsterservice.org/contactus.html

And here is the error I get when trying it:
Name of form element When_do_you_need_the_dumpster? cannot be longer than 20 characters

HELP!!! I don't know where to change that. I am using DW8.

I have created the sendresults.php file and am tired so maybe I should just go to sleep and check in the AM!

Thanks in advance from a tired, overworked designer...

edbr
08-16-2007, 05:01 AM
post your sendresults.php code

carolinawebdesign
08-16-2007, 05:04 AM
Sure...

<?php
//--------------------------Set these paramaters--------------------------
// Subject of email sent to you.
$subject = 'Referral from RussoDumpsterService.org! Please read.';
// Your email address. This is where the form information will be sent.
$emailadd = 'myemailaddress@internetprovider.com';
// Where to redirect after form is processed.
$url = 'http://www.russodumpsterservice.org/contactus.html';
// 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';
// --------------------------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.'">';
?>

edbr
08-16-2007, 05:13 AM
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}

carolinawebdesign
08-16-2007, 05:15 AM
I see that line, but it says not to edit it. I already tried to make it 40 characters, but it just said the same thing, but only with "40" as the number instead of 20.

Please talk as if you are talking to a DW baby, as I am...

edbr
08-16-2007, 06:36 AM
I a code baby to but
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
is setting the length make a copy for safety but delete the above section and try it

carolinawebdesign
08-17-2007, 03:20 AM
Ok I will try it and let you know...

carolinawebdesign
08-20-2007, 01:47 AM
SWEET!!! I took out:
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;

AND IT WORKED !!! GOT THE EMAIL IMMEDIATELY! thanks so much.