Click to See Complete Forum and Search --> : formmail nightmare, please, please help !!


carpetpaul
04-24-2005, 12:44 PM
I'm having a nightmare......trying to get a site based in my isp's freespace to use a formmail script that lies on my main site thats got it's own host. Please view the following bits of code :-

Thanks for looking at this form me ! - Paul
------------------

1, I wondered if this form action part of the code may not be getting the user of the form to the location marked here, i can confirm that the filename of the formail script is correct.


<HTML><HEAD>
<TITLE>Full registration</TITLE>
<!--This code links this page to use the external .css file-->
<link rel="stylesheet" type="text/css"
href="test.css" /></HEAD>

<!-- this code directs the form to the script-->
<FORM action="http://www.cleveleyscarpetcentre.co.uk/cgi-bin/formmail2.cgi" method="POST">


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

2, The first line on the formail script (based at the remote server) is shown here, not exactly sure if this needs to be modified when you consider that the form is to be accessed from outside the server that contains the form script

#!/usr/bin/perl -w


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


3, Here are the variables within the formail script, I'll give you the exact details of the site that is to use this form, and the email that I need to send the form contents to :-

The site is: myweb.tiscali.co.uk/blackpoolsingles
The email is: me-me-me@tiscali.co.uk


Define Variables #
# Detailed Information Found In README File. #

# $mailprog defines the location of your sendmail program on your unix #
# system. The flags -i and -t should be passed to sendmail in order to #
# have it ignore single dots on a line and to read message for recipients #

$mailprog = '/usr/lib/sendmail -i -t';

# @referers allows forms to be located only on servers which are defined #
# in this field. This security fix from the last version which allowed #
# anyone on any server to use your FormMail script on their web site. #

@referers = ('myweb.tiscali.co.uk');

# @recipients defines the e-mail addresses or domain names that e-mail can #
# be sent to. This must be filled in correctly to prevent SPAM and allow #
# valid addresses to receive e-mail. Read the documentation to find out how #
# this variable works!!! It is EXTREMELY IMPORTANT. #
@recipients = &fill_recipients('me-me-me@tiscali.co.uk');

# ACCESS CONTROL FIX: Peter D. Thompson Yezek #
# @valid_ENV allows the sysadmin to define what environment variables can #
# be reported via the env_report directive. This was implemented to fix #
# the problem reported at http://www.securityfocus.com/bid/1187 #

@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');

# Done



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

and here is the error message that I get:-

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@cleveleyscarpetcentre.co.uk 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.cleveleyscarpetcentre.co.uk Port 80

ray326
04-24-2005, 06:17 PM
Does the form handler work ok when the form is posted from your own site?

winged1
04-24-2005, 08:22 PM
Have you confirmed that location of sendmail, it may be at /user/sbin/sendmail ?

@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_U SER_AGENT');

get rid of the space between U & S ('HTTP_U SER_AGENT')

carpetpaul
04-25-2005, 12:38 PM
In reply to both of the above posts:-

Yes the form handler works perfect from the original site where the from script is stored on that same server.

as for the space in the code, I'll certainly alter that and try again, but I'm pretty sure that it's like that in the original (working) copy of this script......but I will double check

As for the '/user/sbin/sendmail ?' - I'm not 100% clear on exactly what this is all about, I'm quite sure it was a default bit of code that I didn't alter from the way it was originally supplied in the script. I know that I didn't alter this when I made the second copy of the script (the one to which I will direct this second site's form) - could it be that this aspect needs to be altered because of the fact that this form operates from outside the location (or server) that this script is stored ?

Thanks again for all the help, sorry to sound a bit thick, but I do find this to be the trickiest bit about websites ! ----- Paul

carpetpaul
04-25-2005, 12:46 PM
That was very observant of you to have spotted that missed space, the bad news is that it's not there in the script that I uploaded, so I'm afraid that I must have accidentally inserted the space after I'd pasted it onto this site.

-Sorry


P.S - do you think that the details for referers and recipients were added correctly bearing in mind the email and domain that I've put in at the top of the first post ?
If I can rule those things out as the cause, it has to be something that has been effected by the fact that this form is accessing the script from outside the location of the script

Ta - Paul