Lunarpages Web Hosting Forum

Author Topic: Formmail HELP!  (Read 7028 times)

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« on: December 01, 2004, 12:36:17 PM »
Hi,

I am tyring to put a form onto my website for the first time and I am running into some problems.

I followed the tutorial, but I recieve a 404 error when I try to use the form.  This is the script I am running

BEGIN
{
  $DEBUGGING         = 1;
  $emulate_matts_code= 0;
  $secure            = 1;
  $allow_empty_ref   = 1;
  $max_recipients    = 5;
  $mailprog          = '/usr/lib/sendmail -oi -t';
  $postmaster        = '';
  @referers          = qw(americanmastersgallery.com localhost);
  @allow_mail_to     = qw(info@americanmastersgallery.com localhost);
  @recipients        = ();
  %recipient_alias   = ();
  @valid_ENV         = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
  $locale            = '';
  $charset           = 'iso-8859-1';
  $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
  $style             = '/css/nms.css';
  $no_content        = 0;
  $double_spacing    = 1;
  $wrap_text         = 0;
  $wrap_style        = 1;
  $address_style     = 0;
  $send_confirmation_mail = 0;
  $confirmation_text = <<'END_OF_CONFIRMATION';
From: info@americanmastersgallery.com
Subject: Thanks!

Thank you for joining our mailing list.  You will be hearing from us soon.

END_OF_CONFIRMATION

I renamed it listprogram.pl and I changed the settings manually to 755.

I've been working on it for a while and I am getting a little discouraged, any help will be greatly appreciated!

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #1 on: December 02, 2004, 06:57:56 AM »
I am still trying to figure out how to get the formmail to work, looking for any ideas anyone may have!

Offline GarveysIT

  • Web Design SEO England UK
  • Berserker Poster
  • *****
  • Posts: 11648
  • Web Design SEO England UK
    • Web Design | SEO | IT Support Stockton-on-Tees, Middlesbrough, Darlington, Durham
Formmail HELP!
« Reply #2 on: December 02, 2004, 07:04:38 AM »

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #3 on: December 02, 2004, 07:15:35 AM »
I followed the thread to the tutorial, but I am still having problems. This is the error message I am getting.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@americanmastersgallery.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


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

Apache/1.3.33 Server at www.americanmastersgallery.com Port 80

The link is www.americanmastersgallery.com and this is the code

form action="cgi-bin/ListProgram.pl" method="post" name="mailinglist" id="mailinglist">
      <table width="340" border="0" cellpadding="10" cellspacing="0">
        <tr>
          <td><p align="right"><em><strong>Join Our Mailing List! </strong></em></p>
            <p align="right"><em><strong>Email Address:</strong></em></p>
            </td>
          <td><input name="emailaddress" type="text" id="emailaddress" size="25"></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><input type="submit" name="Submit" value="Join!"></td>
        </tr>
      </table>
    </form>

Thanks!

Offline GarveysIT

  • Web Design SEO England UK
  • Berserker Poster
  • *****
  • Posts: 11648
  • Web Design SEO England UK
    • Web Design | SEO | IT Support Stockton-on-Tees, Middlesbrough, Darlington, Durham
Formmail HELP!
« Reply #4 on: December 02, 2004, 07:44:19 AM »
i'm guessing your account is new then?

are you using a temporary domain?

you need to wait until your domain propogates or ask support to set you up a lunarpages subdomain ( http://something.lunarpages.com )

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #5 on: December 02, 2004, 08:39:52 AM »
This account is not new nor is it a temporary account.  Any other suggestions?

Offline GMTurner

  • Berserker Poster
  • *****
  • Posts: 7479
    • Turner's Lounge
Formmail HELP!
« Reply #6 on: December 02, 2004, 09:18:37 AM »
There's no need to worry about the 404 error part at the bottom. The main issue is the internal server error, which could indicate there is a problem in the code of the script.

I'm assuming you are using the NMS formmail script, which is what is described in that tutorial. When you uploaded the script to the server did you do it as ASCII? Sometimes the scripts will get transferred as BINARY by accident and that can cause problems like this. I really don't know much about the script itself though, so just offering some more general advice on things I've seen cause problems with a variety of scripts.
The above information may or may not reflect current policy, opinions, or views since it was likely made almost 10 years ago.

Offline TVPR

  • Intergalactic Cowboy
  • *****
  • Posts: 52
    • http://www.lyesmith.net
Formmail HELP!
« Reply #7 on: December 02, 2004, 09:59:43 AM »
I had the very same problem for quite some time before figuring out the error. I had simply fogotten to set the right permissions - without doing so, the script won't be allowed to execute at all.

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #8 on: December 02, 2004, 10:11:06 AM »
Thanks for the tips everyone!  I manually set the permissions in my ftp program to 755 is that all I need to do?

Also how do you transfer the NMS formmail as ASCII?  I just uploaded it to my cgi-bin folder, perhaps this is the problem?  As you can tell I am very new to this!

Offline TVPR

  • Intergalactic Cowboy
  • *****
  • Posts: 52
    • http://www.lyesmith.net
Formmail HELP!
« Reply #9 on: December 02, 2004, 11:15:47 AM »
Most FTP clients - in my personal experience - upload in ASCII by default, and there should be an easy way to pick between using ASCII mode or... that other weird thing.

And if you've set the permissions to 755, that's all right :)

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #10 on: December 02, 2004, 11:40:44 AM »
OK the script appears to be in ASCII, the settings appear to be at 755, so why is my form still not working?  I still am getting the internal error message.

leighsww

  • Guest
Formmail HELP!
« Reply #11 on: December 04, 2004, 03:03:02 PM »
ColleenK,

This line in your script:

Code: [Select]
$mailprog = '/usr/lib/sendmail -oi -t';
Should be:

Code: [Select]
$mailprog = '/usr/sbin/sendmail -oi -t';

Did you follow the tutorial in the link Garvey gave you (because it doesn't seem like you did from what I am seeing of your posts)?

I also couldn't find a form on your site. Please link to the exact page where your form is located, so I can help you better.

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #12 on: December 06, 2004, 06:10:33 AM »
Leigh,

This is my page www.americanmastersgallery.com and the form is at the bottom.  I changed the line in the script but I am still getting an error message.  This is the script now:


BEGIN
{
  $DEBUGGING         = 1;
  $emulate_matts_code= 0;
  $secure            = 1;
  $allow_empty_ref   = 1;
  $max_recipients    = 5;
  $mailprog          = $mailprog = '/usr/sbin/sendmail -oi -t';
  $postmaster        = 'info@americanmastersgallery.com';
  @referers          = qw(americanmastersgallery.com localhost);
  @allow_mail_to     = qw(info@americanmastersgallery.com localhost);
  @recipients        = ();
  %recipient_alias   = ('1' => 'contact@mydomain.com');
  @valid_ENV         = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
  $locale            = '';
  $charset           = 'iso-8859-1';
  $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
  $style             = '/css/nms.css';
  $no_content        = 0;
  $double_spacing    = 1;
  $wrap_text         = 0;
  $wrap_style        = 1;
  $address_style     = 0;
  $send_confirmation_mail = 0;
  $confirmation_text = <<'END_OF_CONFIRMATION';
From: info@americanmastersgallery.com
Subject: Thanks!

Thank you for joining our mailing list.  You will be hearing from us soon.

END_OF_CONFIRMATION

Thanks for your help

Offline toby

  • Galactic Royalty
  • *****
  • Posts: 220
Formmail HELP!
« Reply #13 on: December 06, 2004, 08:13:08 AM »
ColleenK , I just tried your form using my NMS form mail script and everything works fine.  I did get the same error when using yours.  Being the we know the html form is good and what you've listed as your script looks good it must be the permissions.

The only time I get an error message like the one you are getting is when the script is unable to execute.  Hence permissions.  

Permissions should be 755:
7 (Read Write Execute)
5 (Read Execute)
5 (Read Execute)

You might want to double check.  :)

EDIT:  Don't forget to check the permissions on your cgi-bin FOLDER.  It also needs to be set at 755.
“I am curious and interested in just about everything. So, I am always learning and working at the margin of my ignorance.” —Harvey Golub, CEO, American Express.

Offline ColleenK

  • Trekkie
  • **
  • Posts: 11
Formmail HELP!
« Reply #14 on: December 06, 2004, 08:48:12 AM »
Toby, The script is in my cgi-bin and I reset the permissions to 755.  In the FTP program I right clicked on the file opened the change attribute key and set them to 755.  However I am still getting an error message.  Do I need to change the permissions somewhere else?  If so how and where?

I don't mean to sound like an idiot, I am just very inexperienced and getting confused.

Thanks for everything!