Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> 404 when submitting form to formmail.pl
gleeloyd
Posted: May 4 2003, 09:51 AM
Quote Post





Group: Members
Posts: 57
Member No.: 238
Joined: 25-April 03



:cry: I'm getting a 404 when I submit a form to use formmail.pl. I've messed with this 'till I'm blue in the face! Had this form working on Cobalt, broke it when moved to Plesk. I've checked pathing & permissions & filenames and cannot figure it out. Obviously I'm overlooking something silly. To create cgi-bin directory I used WS_FTP to connect, double-clicked on httpdocs, and used MKDIR. Then used chmod to change permissions to 755 on both the directory and formmail.pl. I've tried fully qualified URL and relative in the form's action property.

Form: http://www.automaticsales.net/contact.shtml

POSTS to: /cgi-bin/formmail.pl


--------------------
Gary
PMUsers WebsiteMSN
Top
Dustin
Posted: May 5 2003, 08:47 AM
Quote Post





Group: Members
Posts: 495
Member No.: 6
Joined: 12-July 02



The cgi-bin is already set up on the Plesk server. You'll need to place your scripts in the cgi-bin that's already on the server. This directory exists off the root of your site, so you'd place the files directly into /cgi-bin instead of /httpdocs.

Actually, after taking a look, it appears you've gotten that figured out.

From what you're saying, you successfully submit the form, but are then directed to a non-existent page? The first thing you'll need to do is look through your form and find out what page it's set to redirect to once the form is submitted. From there, you'll want to make sure that page exists. Also, check for capitalization errors as they're often the problem is this situation.
PMUsers Website
Top
gleeloyd
Posted: May 5 2003, 09:04 AM
Quote Post





Group: Members
Posts: 57
Member No.: 238
Joined: 25-April 03



Dustin - yes I did try placing formmail.pl in the [root]/cgi-bin but to no avail. I feel like this is a pathing problem. Please check the urls in my form for the action and redirect page.

Here are my form tags:

QUOTE
<form name="contactform" enctype="text/plain" method="POST"  
action="http:/www.automaticsales.net/cgi-bin/formmail.pl">

<input type="hidden" name="recipient" value="info@automaticsales.net">
<input type="hidden" name="redirect" value="http://www.automaticsales.net/thanks.shtml">


Here is the message from the server after submitting the form:

QUOTE
Not Found
The requested URL /www.automaticsales.net/cgi-bin/formmail.pl was not found on this server.
Apache/1.3.27 Server at www.automaticsales.net Port 80


--------------------
Gary
PMUsers WebsiteMSN
Top
Dustin
Posted: May 5 2003, 09:39 AM
Quote Post





Group: Members
Posts: 495
Member No.: 6
Joined: 12-July 02



It looks like you're missing a slash in the action URL:

http:/www.automaticsales.net/cgi-bin/formmail.pl

Go ahead and try adding that second slash (/) after http:/ and see what happens.
PMUsers Website
Top
gleeloyd
Posted: May 5 2003, 10:40 AM
Quote Post





Group: Members
Posts: 57
Member No.: 238
Joined: 25-April 03



OK I fixed the missing slash and made sure the new page was loaded (w/CNTL-F5) before submitting. This time the 404 message changed slightly:

QUOTE
Not Found
The requested URL /cgi-bin/formmail.pl was not found on this server.


Any more ideas?


--------------------
Gary
PMUsers WebsiteMSN
Top
Dustin
Posted: May 5 2003, 12:50 PM
Quote Post





Group: Members
Posts: 495
Member No.: 6
Joined: 12-July 02



It looks like we've overlooked the most important thing. It doesn't look like CGI is enabled for the site. To enable CGI, log into your Plesk control panel, click on the domain, then click hosting. You should see a checkbox next to "CGI support", so make sure that's checked, then click update. Keep in mind that it may take up to one hour for your change to take effect.
PMUsers Website
Top
gleeloyd
Posted: May 5 2003, 05:28 PM
Quote Post





Group: Members
Posts: 57
Member No.: 238
Joined: 25-April 03



OK - I'm finally talking to formmail.pl - but it apparently does not like what I'm saying! I've read many posts about the perils of editing scripts on an XP machine with WordPad, etc. I downloaded and installed EditPadLite and used it to "convert" formmail.pl to Unix formatting. Then I was carefult to FTP in ASCII mode with the auto feature turned off.

This is displayed to me in the browser:
QUOTE
Error: Bad Header Fields  
The header fields, which include recipient, email, realname and subject were filled in with invalid values. You may not include any newline characters in these parameters. More information on filling in these form fields and variables can be found in the README file.



This is the latest entry in the server log:
QUOTE
Premature end of script headers


--------------------
Gary
PMUsers WebsiteMSN
Top
gleeloyd
Posted: May 5 2003, 05:38 PM
Quote Post





Group: Members
Posts: 57
Member No.: 238
Joined: 25-April 03



FOUND the problem biggrin.gif biggrin.gif biggrin.gif

My form definition had enctype="text/plain" in it, which was causing problems.

I found a post on Google Groups where someone suggested taking this off. AND IT WORKED.


--------------------
Gary
PMUsers WebsiteMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll