Results 1 to 4 of 4
Related
-
how to open save/open dialog using HTML Forum: HTML Forum
Replies: 1 -
problem while executing perl script through browser Forum: CGI Perl Forum
Replies: 0 -
browser blocks script Forum: Javascript Forum
Replies: 2 -
code for downloading, option to open or save Forum: HTML Forum
Replies: 4 -
Launching cgi script in New Browser Window Forum: CGI Perl Forum
Replies: 2
-
09-05-2008, 04:36 AM #1
unable to run perl script on Linux / XP browser, instead asking me to save or open it
I am trying to access perl files from browser, I mean I need to execute perl files from web bowser.
Instead when I am trying to access the perl files it is not executing only the code is coming in the browser,like following,
######################################################################
use CGI;
require "cfaCommon.pl";
require "globVar.pl";
&cfaInitGlobal();
$query = new CGI;
.................
....................
I have included dat........#!/usr/bin/perl file in de perl script and also have give content-type:text/html\n\n also...........but den too........it juz opens a prompt asking me to save or open de perl script.............plz
Can anyone help me out, how the perl file itself will be executed in the browser???
plz reply to pacepurandar@gmail.com
THX
-
09-17-2008, 09:40 AM #2
Re: unable to run perl script on Linux / XP browser, instead asking me to save or ope
Generally it is the content type that would cause that issue.
Make sure you add
print "Content-Type: text/html\n\n";
Right after the shebang in the first line.
The browsers don't car what the file is, but when it trys to print to the page if you havean altrenate content type or error it will ask to save rather than print teh content.
Try running the script from the commad line. If the content type statement is there in the correct place you will see it in the output. If you see anything before it, you know what the error is.
-
09-22-2008, 09:49 AM #3
Re: unable to run perl script on Linux / XP browser, instead asking me to save or ope
It really sounds to me like your server doesn't know what to do with the script. Your browser should never see the script in any way shape or form. Verify the perl engine is installed and running on your server. Also, make sure your server is configured to send perl scripts through the perl engine.
-
01-03-2009, 12:44 PM #4
Re: unable to run perl script on Linux / XP browser, instead asking me to save or ope
Just in case...
If you are opening up perl files in your browser from your computer then perl must be installed on your computer otherwise it will do exactly what you are seeing...
Otherwise you will have uploaded your file to a web server and typed in the web address to it, which should work fine or give you an error 500...
Where is your shabang line, and where is perl located? client or server side?
Chris
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum