Solved

Probably EASY FOR YOU !

Posted on 1998-11-16
17
197 Views
Last Modified: 2013-12-25
I have been setting up my FIRST ever CGI form webpage. (I've done many forms. . .mailto: type).  I have one of those free websites with CGI-bin, but when I set everything up and hit SUBMIT on the form, I get an error that says "URL not found /cgi-bin/forms.pl".  The forms.pl file IS in the cgi-bin directory.  Is there something in the code I need to change?  Perhaps the first line?
0
Comment
Question by:gugis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +5
17 Comments
 
LVL 1

Author Comment

by:gugis
ID: 1829603
Edited text of question
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1829604
you'd better post the HTML form source. Also look at the FAQ of your "free websites with CGI-bin" provider - maybe there is some usefull info that can help you

  heyhey

0
 
LVL 1

Expert Comment

by:flivauda
ID: 1829605
Two possible problems:

1) you arent referencing the file correclty.  This one is most likely, the odds are you are calling the file http://www.domain.com/cgi-bin/forms.pl when the directories may be mapped differently.  I have a cgibin that is referenced by http://www.domain.com/cgi-bin/comm/companyname/forms.pl

2) You dont have execute permission for your form.  You can change this with a
chmod +x forms.pl
This doesnt sound like your problem since it is saying it cant find the file and not that you dont have permissions
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 1

Expert Comment

by:wisdom042597
ID: 1829606
Many web sites which offer "free cgi-bin" access are set NOT set up to designate a particular directory as a cgi-bin dir - they usually look for an executable file with an extension of .cgi - consider making sure your executable has that extension and has the +x bit enabled.

0
 
LVL 2

Expert Comment

by:ventolin
ID: 1829607
please post the location of your form and i will look at it for you...

-ventolin
0
 
LVL 1

Author Comment

by:gugis
ID: 1829608
Thanks for your responses guys. . .

Here is the source code . . . .

#!/usr/bin/perl
###################################################################
## Form-To-EMail Version 1.4 - 07/22/98                          ##
## ------------------------------------------------------------- ##
## Copyright (C) 1998 Dimension's CGI Workshop                   ##
## http://www.thenetnow.com/dimension                            ##
## dimension@cybered.net                                         ##
## ------------------------------------------------------------- ##
## This script is freeware and may not be sold in any way.  If   ##
## you would like to make changes to this script, please EMail   ##
## me and ask for my permission before doing so.  Once recieving ##
## my permission, this notice must remain in place.              ##
###################################################################

###############################################
### ****** CUSTOMIZE THESE VARIABLES ****** ###
###############################################
# Name (and location if necessary) of the server's mail program
$mailprog = 'sendmail';
###############################################

###############################################
### ***** DO NOT EDIT BELOW THIS LINE ***** ###
###############################################

# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Split the name-value pairs
@pairs = split(/&/, $buffer);

foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);
   $name =~ tr/+/ /;
   $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $name =~ s/<!--(.|\n)*-->//g;
   $name =~ s/<([^>]|\n)*>//g;
   $value =~ tr/+/ /;
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $value =~ s/<!--(.|\n)*-->//g;
   $value =~ s/<([^>]|\n)*>//g;
   $FORM{$name} = $value;
}

# READ HIDDEN VARIABLES FROM FORM

$subject = $FORM{subject};
$to = $FORM{to};
$from = $FORM{from};
$followupurl = $FORM{followupurl};

# Open the mail program
open(MAIL,"|$mailprog -t");

# Send the mail program the EMail message
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n";
print MAIL "\n";
print MAIL "---------------------------------------------------------------------\n";

foreach $key (keys(%FORM)) {
   if ($key ne "subject" && $key ne "to" && $key ne "from" && $key ne "followupurl") {
      print MAIL "$key: $FORM{$key}\n";
   }
}

print MAIL "---------------------------------------------------------------------\n";
print MAIL "Form-To-EMail version 1.4\n";
print MAIL "(C) Dimension's CGI Workshop - http://www.thenetnow.com/dimension/\n";

# Close the mail program
close(MAIL);

# Forward to the Follow-up URL
print "Location: $followupurl\n\n";


0
 
LVL 1

Author Comment

by:gugis
ID: 1829609
The above is called forms.pl

In the form itself, I make reference to to file (forms.pl) through action:

<FORM ACTION="cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">

I suspect the HTML code is fine and my ignorance of perl / CGI is the hold up.

I changed NOTHING in the forms.pl file . . . .should I ?
0
 
LVL 2

Expert Comment

by:ventolin
ID: 1829610
please post the url, including servername of this html page.
0
 
LVL 1

Author Comment

by:gugis
ID: 1829611
Im not sure how much info I should post here due to SECURITY risks. . .

I understand CGI programs enable many BACK DOORS to the server. ..
0
 
LVL 1

Author Comment

by:gugis
ID: 1829612
Can anyone give some probable causes ?

Remember, I get a message saying that the forms.pl cannot be found.  
0
 
LVL 2

Expert Comment

by:ventolin
ID: 1829613
i think the problem is how you referenced the script. your action points to "cgi-bin". this means that if your page is in yourserver.com/users/g/gugis/form.html, then the cgi-bin would have to be yourserver.com/users/g/gugis/cgi-bin/.  this is probably not the right place. a not found error indicates you have the wrong path to the cgi-bin or form.pl is not where it should be. this is why i asked for the url. it would be easy to see what is wrong. the people here, for the most part, are trying to help you -- i wouldn't be that concerned over security.
0
 

Expert Comment

by:bobline
ID: 1829614
Try the full URL like http://www.yourdomain.com/~you/cgi-bin/forms.pl instead of cgi-bin/forms.pl
0
 
LVL 1

Expert Comment

by:flivauda
ID: 1829615
Basicallt ventolin and bobline are right when you are calling the form like this:
<FORM ACTION="cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">

you are saying call the file forms.pl and it will be in the directory cgi-bin which is located directly below this one, so if your html file was in this directory:
/mypath/html/htmlpage.html
if would be looking for forms.pl in:
/mypath/html/cgi-bin/forms.pl if this isnt the case then ther eis your problem. I would do what bobline says make it say:
<FORM ACTION="http://www.mydomain.com/cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">

and you should be golden
0
 
LVL 1

Author Comment

by:gugis
ID: 1829616
I will try your suggestions this weekend.  YOU GUYS ARE GREAT. Thank you so much for attempting to rectify my problem !
0
 
LVL 4

Expert Comment

by:mikem
ID: 1829617
You have typed..

<FORM ACTION="cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">
You will probably need to change it to
<FORM ACTION="/cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">

or

<FORM ACTION="../cgi-bin/forms.pl" METHOD="POST" ENCTYPE="text/plain">

Or as Flivauda mentioed above..

Mike

0
 
LVL 1

Accepted Solution

by:
rcesmusic earned 100 total points
ID: 1829618
Your ISP probably uses Formmail or something.  He can Email you a sample page that refers to HIS cgi-bin.  If you get a free 2 or 3 meg webpage with this ISP, do the rest of your site on the FREE website you mentioned above and put the FORM on your ISPs server (just make a link to it).

If you're lucky, you may find your error when analyzing the working script provided by your ISP !

good luck.

0
 
LVL 1

Author Comment

by:gugis
ID: 1829619
My ISP did it all for me. . . he walked me through the process and gave me some code to link to his mail processing program.

Thanks for the tip rces. . .
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

736 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question