Solved

Probably EASY FOR YOU !

Posted on 1998-11-16
17
186 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
  • 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now