Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Really need help!

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
Hi,
I have written a perl script and i'm calling it from the action of a form of an html file.
But when i press the submit button, it asks me if i want to download it or lauch it from its current location.
if i choose the second option, it runs in the command prompt.
What should i do to have it on my html page.
( N.B.: I have included the content-type: text/html and the html tgas )

???????
please help........
 
There could be several reasons.....

One guess:
If your web server is not setup to do cgi, then it will not execute the file. Consequently, the response to the browser appears as though the browser should try to download the file.

What OS? (Unix, Win(i), other)
What web server? (apache, IIS, other?)
Can you get a brutally simple cgi example work?
You might look at faq452-653 in the cgi -forum.

HTH


keep the rudder amid ship and beware the odd typo
 
My guess would be the same as goBoating's - your webserver is probably not configured properly to do cgi. If you're using an Apache webserver, you'll need to have *at least* this setting in "httpd.conf", and maybe more:

#
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
AddHandler cgi-script .cgi

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

If you've changed your httpd.conf, you need to restart your webserver(or signal it via HUP, but don't attempt this HUP method unless you know what you're doing) to get it to recognize the changes.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
If your web server IS already set up to run cgi scripts, make sure you put the script in your cgi directory (usually cgi-bin or cgi-local) and call it from your form action as "/cgi-bin/program.pl" or "/cgi-bin/program.cgi". Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I'm working on windows 2000 Advanced Server
and i have created a virtual directory in which the scripts exist.
I didn't put the perl code in a cgi file. I left it .pl but it should work this way.
What should i do concerning the configuration of the server.

 
'not a clue.... I live in a UNIX/Apache world. Sorry.

My best suggestion is to look into the Server documentation. It should give some clear directions on how to get CGI stuff to work.

Hopefully, someone else out there know a lot more than I. 8-)


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top