Closed Thread Icon

Topic awaiting preservation: Form Problem Pages that link to <a href="https://ozoneasylum.com/backlink?for=12114" title="Pages that link to Topic awaiting preservation: Form Problem" rel="nofollow" >Topic awaiting preservation: Form Problem\

 
Author Thread
Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-15-2002 15:39

I stayed up all night, I am tired, I read bunch of tutorials and I am very frustrated.

Here is scenario:

I have a form. Big one. It will go thought secure server...

I am running Perl script from one site that MrMax posted in Jeni's post. http://bignosebird.com/carchive/bnbform.shtml I also read the entire thread but its about PHP so that won't help me.

I made a little test thing at http://www.studiosone.com/test/FormMail.html

now when I fill in the info and hit submitt and it tells me Forbiden! WHY?? I have access..I even check all the permission boxes on my cgi-bin folder..

What am I doing wrong????


:: m a x ::

[This message has been edited by Ducati (edited 03-16-2002).]

[This message has been edited by Ducati (edited 03-16-2002).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-15-2002 19:06

Hokay first you need the permissions set on the folder allowing you to upload, also check for any .htaccess file that may be mucking up the works (if you have telnet or ssh access use ls -a to view all files) then you need to also make sure the file is chmod ed to 755 (I think) finally check the extensions. If the server has mod_perl it may muck up how it handles .cgi vs. .pl files
(I'm having this problem too)

finally make sure that your path to perl is correct. (the first line in the script) again with ssh or telnet do "which perl" to find the path



.:[ The Tao of Steve ]:.
Be Desireless
Be Excellent
Be Gone
...................................

[This message has been edited by bitdamaged (edited 03-15-2002).]

Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-16-2002 09:32

Ok.. I tried and tried and tired.. I can't figure out what I am doing wrong.. I am trying to learn on a simple form with just fre fields. So I created it, transfered my files but it just doesn't work....I am following the instructions from Matt Wright's FormMail. It looks logic and I think I am doing everything right but for some reason I am getting 500 error..

I changed permissions to 755 as it was said in the tutorial....

Form can be looked at: www.studiosone.com/test/FormMail.html

So here it is..

My Perl Path is:

/usr/local/bin/perl

My Sendmail Path is:

/usr/sbin/sendmail

and FormMail.cgi file is placed in:

cgi-bin/FormMail.cgi

Following Matt's Instructions I configured this script so it can send me e-mail to contacts@studiosone.com and info@studiosne.com

So here is a cgi file script:

#!/user/local/bin/perl
##############################################################################
# FormMail Version 1.9 #
# Copyright 1995-2001 Matt Wright mattw@worldwidemart.com #
# Created 06/09/95 Last Modified 08/03/01 #
# Matt's Script Archive, Inc.: http://www.worldwidemart.com/scripts/ #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1995-2001 Matthew M. Wright All Rights Reserved. #
# #
# FormMail may be used and modified free of charge by anyone so long as this #
# copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Matthew M. Wright from any liability that #
# might arise from its use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact #
##############################################################################
# ACCESS CONTROL FIX: Peter D. Thompson Yezek #
# http://www.securityfocus.com/archive/1/62033 #
##############################################################################
# Define Variables #
# Detailed Information Found In README File. #

# $mailprog defines the location of your sendmail program on your unix #
# system. #

$mailprog = '/usr/sbin/sendmail';

# @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 = ('studiosone.com','64.91.231.122');

# @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 = ('^contacts@studiosone.com','^info@studiosone.com');

# 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 #
##############################################################################

# Check Referring URL
&check_url;

# Retrieve Date
&get_date;

# Parse Form Contents
&parse_form;

# Check Required Fields
&check_required;

# Send E-Mail
&send_mail;

# Return HTML Page or Redirect User
&return_html;

sub check_url {

# Localize the check_referer flag which determines if user is valid. #
local($check_referer) = 0;

# If a referring URL was specified, for each valid referer, make sure #
# that a valid referring URL was passed to FormMail. #

if ($ENV{'HTTP_REFERER'}) {
foreach $referer (@referers) {
if ($ENV{'HTTP_REFERER'} =~ m

Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-16-2002 09:52

ok I just ran the cgi test from telnet and this is what it told me:

syntax error at FormMail.cgi line 1, near "/user/local"
Bareword found where operator expected at FormMail.cgi line 1
(Missing operator before perl?)
Execution of FormMail.cgi aborted due to compilation errors.


WTF????

:: m a x ::

Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-16-2002 13:15

Hhmm.. I messed around with it for a while and I noticed..

When I log on using my FTP Client I right click on my cgi-bin folder and set the permission click OK and I see on status bar it says that it changed it to 755

So then I go to my test form and try to submit it and it gives me Internal Error sooooooooooo....

I go back to my FTP client and check the permission and they are reset

Might that be a problem??? I know I can follow directions and this isn't that hard but its not working so I am thinking that it might be my server problem... what do you guys think?

:: m a x ::

Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-16-2002 13:35

OH MFG!!!!!!!!!!!!!!!! I can't belive this...

I FIGURED IT OUT!!!! I been up for almost 48hrs reading all this stuff and I finally got it!!!!!!!!!!!!!!!!!!!!!!!!!!!!

what a dumb ass I am! I had /user/local/bin/perl instad of /usr/local/bin/perl

Little thing like that!

Oh well.. I learned a lot from this...Looks like I was talking to myself in this thread LOL!!!!!!!!!!!!!

Oh I am so happy!!!!!!!!!!!

:: m a x ::

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-16-2002 13:41

congrads!

but why not use php?

Ducati
Paranoid (IV) Inmate

From: in your head
Insane since: Feb 2001

posted posted 03-16-2002 14:48

WEll... I kind of started to do this thing and put lots of time in it ..

I know nothing about programming and some tutorials said that Perl is pretty much simple and easy (yeah right). I read Gurus tut and it gave me some idea. Although I used Matt's Script it still helped me to peak around the code

What would be advantages of using PHP???



:: m a x ::

RammStein
Paranoid (IV) Inmate

From: cEll 513, west wing of the ninth plain
Insane since: Dec 2000

posted posted 03-16-2002 16:26

the two words I hate the most

"syntax error" .. LOL .. those two words suck when they decide to pop up on you and you spend HOURS ON HOURS trying to find the problem .. and you realize it's a small thing like that 'user' to 'usr'

grrrrrrrrrrrrrr

sYntAx eRRoR .. eat me!

lol

[note: as a joke to myself .. my registared name over at gurusnetwork community board is sYntAx eRRoR]


GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 03-16-2002 16:52

well for example just what rammstein siad. in php you get helpful error messages so you know where to look for the error.

and what i like most about it:
you can do anything! (though something may not be "well coded" but everything, anything works!)
and its easy!

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 03-16-2002 18:57

Ducati, for your quest to hapiness: http://www.ozoneasylum.com/Forum1/HTML/003499.html

Jason

« BackwardsOnwards »

Show Forum Drop Down Menu