• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1656
  • Last Modified:

CGI-BIN Formmail

Recentally I moved my website from one host to another as well as changed the domain name.  After doing this my contact forms no longer worked.  I have now experience with cgi and have no clue where to start.  Any ideas...???

Thanks for your time,
Ioannes
0
Ioannes-Gill
Asked:
Ioannes-Gill
  • 5
  • 5
  • 3
  • +1
1 Solution
 
Ioannes-GillAuthor Commented:
This is what I get when a form is submitted:

Forbidden

You don't have permission to access /cgi-bin/formmail/ on this server.

Apache/2.0.46 (Red Hat) Server at www.gillgroup.com Port 80
0
 
nicholassolutionsCommented:
can you tell us the contents of your cgi-bin/formmail folder (i.e. list the file names)? I have a feeling that you have some file called index in there, to which your form should point (rather than simply cgi-bin/formmail/).
0
 
Ioannes-GillAuthor Commented:
There is nothing in the transferred or originating cgi-bin/formmail folder.  However, there are several files in the main cgi folder.  
They are as follows:

  Formmail folder
  online folder
  SiteSparks folder
  autod2.cgi
  autoresponder.cgi
  FormMail.cgi
  MasterInfoRelay.cgi
  MasterPreInstallationTester.cgi
  htsearch - ht digger file
  insecure.formmail - formmail file
  demo.html
  autod2.pl
  cgi-lib.pl
  eforms.pl
  eforms.pl.old.pl
  FormMail.pl
  m2m.txt
  ms.txt
  readme.txt
  README_formmail.txt
  s42.txt
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mrielfCommented:
The problem is in your html code...

replace this line in your contact.html

 <form method="POST"action="./cgi-bin/formmail"name="contactform">

with this:

 <form method="POST" action="/cgi-bin/FormMail.cgi" name="contactform">
0
 
mrielfCommented:
Replace this in download.html

<form name="sampledownload" method="POST" action="../cgi-bin/formmail">

<form name="sampledownload" method="POST" action="/cgi-bin/FormMail.cgi">
0
 
Ioannes-GillAuthor Commented:
Well...  That at least gave me a new error....  Here it is...

Internal Server Error

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

Please contact the server administrator,  john.clay@gillgroup.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.

Apache/2.0.46 (Red Hat) Server at gillgroup.com Port 80

Thanks for your help though..
0
 
mrielfCommented:
Please include server error log...
0
 
mrielfCommented:
Check this line in FormMail.cgi

@referers = ('http://****.com');

Maybe ****.com is your old domain name, replace it with your new domain name.

Also, make sure the script is 755 executable.
0
 
Ioannes-GillAuthor Commented:
As far as the error log... I'm not sure if you'd want me to post that many characters here..  

The FormMail.cgi file is blank...  Previously, I thought this was normal as it appeared this way when the form worked before the move.
Should something like this be here:

<form method="POST"action="./cgi-bin/FormMail.cgi"name="contactform">
        <input type="hidden" name="recipient"value="postmaster@gillgroup.com">
        <input type="hidden" name="subject"value="GG CONTACT MESSAGE">
        <input type="hidden" name="redirect"value="../cthankyou.html">
        <input type="hidden" name="required"value="name,company,email,phone">
        <input type="hidden" name="env_report"value="REMOTE_HOST,REMOTE_USER,HTTP_USER_AGENT">
        <input type="hidden" name="missing_fields_redirect"value="../cfieldmissing.html">
0
 
mrielfCommented:
FormMail.cgi is blank? Then there is a problem :)

FormMail.pl is blank too? If yes, then get formmail script from here:
http://www.scriptarchive.com/download.cgi?s=formmail

0
 
nicholassolutionsCommented:
1) For your error log, it WOULD be helpful if you could post the most recent entries (say the top 50 lines) -- don't worry about posting too many characters.

2) One possible cause of the server error could be incorrect permissions on the files. The permissions should probably be set to 755 or 711 (i.e. owner has all permissions, and everyone else either has read/execute permissions [755], or execute permissions only [711])

3) Another possibility is an error in uploading: Did you make sure to upload all the cgi files as ASCII (not binary)?

4) Another common cause of problems is errors in endline conversions between Unix and Windows. Did you perhaps download the files to a Windows PC (possibly opening and saving some or all of them), and then upload it to your server? Your Unix line endings may have been converted to Windows, which can cause errors when the script compiles.

5) try putting the following line in your script at te top (right below the #!/usr/bin/perl line)

use CGI::Carp qw(fatalsToBrowser);

This will cause perl errors to be shown on the web page, which may give you some hints as to what is going wrong.

6) #5 made me think of yet another possibility -- is your path to perl right at the top of the script? on your old server it may have been slightly different. Some common paths to perl are:

#!/usr/bin/perl
#!/usr/local/bin/perl

Hope some of that helps you out,
Matt
0
 
gripeCommented:
Hi mrielf,
> FormMail.cgi is blank? Then there is a problem :)

> FormMail.pl is blank too? If yes, then get formmail script from here:
http://www.scriptarchive.com/download.cgi?s=formmail

Just as a helpful suggestion (Points not necessary) - Please DO NOT use the FormMail script from Matt's script archive. It is rife with security problems and obsolete code/style and should not be used. There is a project to update all of the popular MSA scripts which has been undertaken by a group of proficient perl coders called 'NMS'. It is even endorsed by Matt Wright from scriptarchive himself.

You can get the updated NMS formmail from:

http://nms-cgi.sourceforge.net/

Here is Matt Wright's endorsement:

http://www.scriptarchive.com/nms.html

Again, please don't use FormMail from scriptarchive.com.

0
 
nicholassolutionsCommented:
Oh well gripe, sometimes you try to help a guy out and he just wont listen....
0
 
gripeCommented:
Sadly, it'll be his loss and not mine when some unscrupulous spammer launches the spam campaign of the century from his webserver. :)
0
 
gripeCommented:
But then again, maybe he did do the right thing.. i did say 'no points necessary' :)
0
 
Ioannes-GillAuthor Commented:
Actually... I just paid a tech to get it over with in 20 minutes......  They also updated it to the newer version for me.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now