40 users online (0 members and 40 guests)  


  Results 1 to 4 of 4

Related

  1. how to open save/open dialog using HTML    Forum: HTML Forum
    Replies: 1
  2. Replies: 0
  3. browser blocks script    Forum: Javascript Forum
    Replies: 2
  4. Replies: 4
  5. Launching cgi script in New Browser Window    Forum: CGI Perl Forum
    Replies: 2
  1. #1
    purandar's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2008
    Posts
    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

  2. #2
    pageBuzz.com's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    21

    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.

  3. #3
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    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.

  4. #4
    xmassey's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    100

    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



Tags for this Thread