Forum Moderators: coopster & phranque

Message Too Old, No Replies

Need help with cgi file.

         

Ken_Rogers

5:16 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



I've just set up a website with a new server. Apparently, in order to make the order form work with the CGI file, I need to add my url to the "formmail.cgi" @referers list. I'm not sure how to edit the .cgi file and re-save it to the server. I copied the .cgi file to my desktop, edited with notepad, then saved it with a .cgi extension. When I uploaded it back to the cgi bin, it looked like a text file, didn't have the .cgi extension and didn't work. Help!

Ken

maccas

5:32 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Hi and welcome Ken_Rogers, can't you just rename it on your computer to formmail.cgi? Have you got "hide extensions for known file types" checked? open a folder and tools > options > view

Don't forget to upload in in ascii mode and chmod it to 755

Ken_Rogers

7:01 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Don't forget to upload in in ascii mode and chmod it to 755

This is new to me. What software do I need for this? Thanks.

Ken

maccas

7:20 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



FTP software ( [webmasterworld.com...] ) . What are you currently using to upload your files to your server?

KevinADC

7:59 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



when saving a file with notepad, and most editors, you can put quotes around the name to preserve the extension you want, so when saving your file in notepad you enter:

"formmail.cgi"

in the save as box, make sure to include the quotes.

Ken_Rogers

10:49 pm on Sep 28, 2005 (gmt 0)

10+ Year Member



Still having difficulties...

I was able to upload the file using WS FTP, with ASCII transfer mode, chmod 755 settings. The file appears in the cgi bin as "formmail.cgi". When I fill out an order form on my website and click "submit", I get the following error:

"The server encountered an internal error or misconfiguration and was unable to complete your request."

In my form I have entered the following line:
action="/cgi-bin/formmail/formmail.cgi

I have modified the formmail.cgi file provided by my server company, by adding the following line:

@referers = ('example.ca','https://www.example.c2.example2.com')

I was told that I need to add my third-level domain to the @#referers list. Not sure if I've done this correctly or not.

Please help.

kenny

[edited by: coopster at 11:03 pm (utc) on Sep. 28, 2005]
[edit reason] removed url and generalized urls [/edit]

KevinADC

3:06 am on Sep 29, 2005 (gmt 0)

10+ Year Member



are you uploading to the cgi-bin or to another folder in the cgi-bin?

maybe this:

action="/cgi-bin/formmail/formmail.cgi"

should be:

action="/cgi-bin/formmail.cgi"

make sure the path to perl is correct for your server, the fisrt line of the script:

#!/usr/bin/perl

that is the most common one but some servers are different.

Ken_Rogers

3:09 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



I've got the path-to-perl correct, and yes, I am uploading to a folder within the CGI folder. I think maybe I've ruined the CGI file. To edit it, I downloaded it to my computer, edited with notepad, then uploaded it again with the settings we discussed. I will go to formmail.com and get a new file, perhaps.

Kenny

Ken_Rogers

8:57 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



Downloaded formmail.pl from MSA, activated .pl extensions on my server, set path-to-perl, set CGI location on my form.

Tested my order form, and got the "Success!" page, but I never received the email.

Go figure! I'm starting to get that lost, lonely feeling ... should go find a forum for idiots somewhere?

Kenny

KevinADC

9:19 pm on Sep 29, 2005 (gmt 0)

10+ Year Member



hehehe.... we have probably all been there and done that so most of us can sympathise with you, I know I can. That is a confusing script though, so don't beat yourself up too much. I ain't no perl pro but I am a competent layperson, and the instructions for that script are damned confusing to me. Just keep your nose to the grind stone and eventually you will figure it out. You already have accomplished quite a bit to get this far, so keep at it.

Personally I think you should use the NMS version of that script though:

[nms-cgi.sourceforge.net...]

mods: please don't remove the URL. I have no connection with NMS and always recommend it over MSA equivalents.

Ken_Rogers

1:51 am on Sep 30, 2005 (gmt 0)

10+ Year Member



Thanks for that, I'll give it a try.

Kenny