Web Hosting Talk







View Full Version : Form Problem


Wassercrats
08-28-2001, 06:52 PM
After several suggestions from my current host's customer service, I still can't get my form to work. Anyone care to copy it to their site (temporaraly), point the formaction tag to your formmail program and try it? Or try submitting the form from my site and looking at the code and telling me what the problem is? It may be a bug in the filemanager I'm using (the second file manager in a row that messed with my form), or it may be something else.
My form is at

(I just deleted the link. I was informed that my version of formmail isn't secure. See my message below for my files in attachments)

JustinK
08-28-2001, 07:22 PM
Make sure all your paths within the program are correct. Being that it doesn't display the error, it could be just about anything. Is the script chmoded to 755? Also, read through the readme/installation file that came with the script and make sure you've supplied all the required input tags.

Wassercrats
08-29-2001, 05:20 PM
For anyone with a little spare time who would like to help prevent a struggling web master from pulling his hair out... I'm attaching my form and (maybe in the next message) the formmail script that I customized a few months ago. According to my web host's support team, the problem is with the form, so you may want to ignore formmail. Does it work for you? You may not even have to use it to tell me the problem... notice the long sentences in some of the name tags. Could they be causing the problem? Support's last suggestion was that I make them into one word instead of sentences, but that would require that I completly re-design the form and the script. The form and script worked fine on Hypermart, and I'm wondering if that was a freak occurance or if I should find a host on which the form will work as written.

Note that I deleted some paths and email address. Just assume those were correct. This whole project is beyond the call of duty for you people, but my version of formmail may be useful to you if you understand how it works. It's based on an old, insecure version of formmail, so don't use it as is, except for non-public testing.

Thanks!

Wassercrats
08-29-2001, 05:23 PM
And here is my version of formmail

Wow... I guess .txt files get displaied as html. Don't know if you can extract the code from this formmail script. I know I can't from this computer.

drhonk
08-29-2001, 06:17 PM
Two things that are missing on your formmail script.

1. Path to sendmail
2. Referrer which is going to be the url of you site and/or IP address. You can put more than one referrer separated by a comma.

Once you got these two, your formmail should work.

Wassercrats
08-30-2001, 04:31 PM
Nope, I checked those lots of times and they would have been the first things support checked. The copy I attached here was edited so you wouldn't see my email address or the web address of my current host. I just checked the latest edition of formmail, properly configured but otherwise not messed with by me, with a sample form from some other website and it didn't work. I guess it's the server or webserver. I'm still investigating.

Wassercrats
09-01-2001, 08:24 PM
I already have this on the clipboard, so I might as well add it here. I posted it on askme.com and it's destined for experts-exchance.com:

Could someone tell me why the following addition to my Formmail program makes it work with my old web host (Hypermart) but not my new one who uses Perl Version 5.005_03? I changed two parts of Formmail version 1.6. In each part, I added:

{$temp=$Form{$field};}
{if ($Form{$field} eq "on"){$Form{$field} = "";}}

and:

{$Form{$field}=$temp;}

Below are the code snippets with my additions as they appear in my version of Formmail.

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

# For each form field, if it has a value or the print blank #
# fields option is turned on print the form field and value. #
foreach $field (@Field_Order) {
if ($Config{'print_blank_fields'} || $Form{$field})
{$temp=$Form{$field};}
{if ($Form{$field} eq "on"){$Form{$field} = "";}}
{
print "<b>$field</b> $Form{$field}<p>\n";
}
{$Form{$field}=$temp;}
}

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

# For each form field, if it has a value or the print blank #
# fields option is turned on print the form field and value. #
foreach $field (@Field_Order) {
if ($Config{'print_blank_fields'} || $Form{$field} ||
$Form{$field} eq '0')
{$temp=$Form{$field};}
{if ($Form{$field} eq "on"){$Form{$field} = "";}}
{
print MAIL "$field $Form{$field}\n\n";
}
{$Form{$field}=$temp;}
}

bert
09-02-2001, 06:51 PM
A good suggestion:

Try changing the name of your fields to single words like support said. I have a good feeling that it will solve the problem.

Wassercrats
09-02-2001, 07:29 PM
I had that feeling too, especially since support told me about the error that's produced by submitting my form:

Hi,
From the logs, here is the issue:

[Tue Aug 28 02:36:29 2001] [error] malformed header
from script. Bad header=Recipient names must be specified

It looks like you aren't specifying a recipient name in your form.
---------------------------------

I clearly WAS specifying a recipient in my form. I figured the long name fields were overwriting the recipient information. But then I uploaded a normal form. pointed it to formmail, and that didn't work either! Thats when I tried a normal version of formmail, and it worked. But my customized version of formmail works on Hypermart! SHOOT ME!

:nuts: