cgi

how to call pm files from index file in perl?

I want to use files that are inside cgi-bin folder in perl, I want to call them from index.cgi When I do this: use cgi-bin/file_name it doesn't work, how can I do that? ...

Improving performance of cgi

I have 5 python cgi pages. I can navigate from one page to another. All pages get their data from the same database table just that they use different queries. The problem is that the application as a whole is slow. Though they connect to the same database, each page creates a new handle every time I visit it and handles are not shared ...

Ruby Apache CGI Premature end of script headers

I'm trying to make a simple redirect work. I've gotten everything else to work just fine. For example, this works: #!/usr/bin/env ruby puts "Content-type: text/html" puts puts "<h1>blah</h1>" But this doesn't work (this is where I get the "Premature end of script headers" error): #!/usr/bin/env ruby puts "Status: 302 Found" puts ...

C# client - how would I communicate / interact with a CGI script running on a server?

Hi folks, I'm probably totally betraying my ignorance at this point, but I have pretty much zero background in web programming, so I'm flying blind. There's a web-based interface to an application here at work I'd like to knock up a quick client to, for a couple of reasons I won't bother going into. My client will be written in C#, an...

best way to write code to compile with strict

What is the best way to check arguments provided to subroutines to compile with strict ( my solution works but there is a better way of doing it ? ) I have a large old library, I want to correct the code so I can add use strict; to it, most of my error are like this (on a page load it generates 189 errors): Use of uninitialized value i...

mod_wsgi, mod_python, or just cgi?

Hi, I've been playing around with my own webserver (Apache+Ubuntu) and python. From what I've seen there are 3(?) main ways of doing this: Apache configured to handle .py as cgi Apache configured to use mod_python that is now outdated(?) Apache configured to use mod_wsgi I recall reading that Django prefers mod_wsgi, and I'm kinda i...

missing hgwebdir.cgi

I cant find the hgwebdir.cgi on my installation path on linux server. I am trying to find a means to publish the repositories on the server. Mercurial version in use is Mercurial 1.6. Please let me know if I am looking for a wrong file or if it is no longer needed in 1.6 to be able to publish multiple repos. ...

What does it mean at the top a .cgi file "#!/usr/bin/env php" versus "#!/usr/bin/php"?

I usually see #!/usr/bin/php or #!/usr/bin/perl at the top of a CGI file. How is a #!/usr/bin/env php or #!/usr/bin/env perl different from the first 2 lines? They work as well. ...

Segmenting AJAX responses in perl CGI?

Is it possible for a perl cgi script to segment its AJAX responses into numerous individual HTTP responses? Say I have this code: xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { onDataReceived(xmlhttp.responseText); } else if(xmlhttp.statu...

how can i find out the uploaded file name in python cgi

i made simple web server like below. import BaseHTTPServer, os, cgi import cgitb; cgitb.enable() html = """ <html> <body> <form action="" method="POST" enctype="multipart/form-data"> File upload: <input type="file" name="upfile"> <input type="submit" value="upload"> </form> </body> </html> """ class Handler(BaseHTTPServer.BaseHTTPRequ...

From a python cgi can I write to Lighttpd log file?

I have a python cgi script (just python, I didn't use any framework). It's served using Lighttpd on openSUSE. I would like to redirect my logging statements (like logging.info and so on) to be included to Lighttpd log file. If this can't be done, how can I create my own log file? ...

Python/feedparser script won't display on CGI/ character coding

#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import cgi import string import feedparser count = 0 print "Content-Type: text/html\n\n" print """<PRE><B>WORK MAINTENANCE/B></PRE>""" d = feedparser.parse("http://www.hep.hr/ods/rss/radovi.aspx?dp=zagreb") for opis in d: try: print """<B>Place/Time:</B> %s...

Further question on segmenting AJAX responses

This question is related to one I asked previously, see here. As a way to implement segmented ajax responses, I created a code which does this: The client first calls the script which initializes the process. On the server side, the startScript.cgi code starts generating data, and as it does this, it groups the responses into chunks, a...

CGI to Handle Multiple Requests on a Persistent HTTP Connection

CGI programs typically get a single HTTP request. HTTP 1.1 supports persistent HTTP connections whereby multiple HTTP requests/responses are made w/o closing the connection. Is there a way for a CGI program (or similar mechanism) to handle multiple HTTP requests/responses on the same connection? I am using Apache httpd. ...

How do I decode a CGI form?

How do I decode a CGI form in Perl? ...

How do I obtain the current URL in Perl?

What's the Perl equivalent for the following PHP calls? $_SERVER["HTTP_HOST"] $_SERVER["REQUEST_URI"] Any help would be much appreciated. ...

Perl CGI & JavaScript | Select Option troubles

I'm having a tough time trying to figure out why the following code isn't working: test.cgi: #!/usr/bin/perl -w use CGI; $cgi = new CGI; $cgi->autoEscape(undef); %ptype = ("0","","1","Pennsylvania","2","New York","3","Ohio"); print $cgi->header('text/html'), $cgi->start_html(-title=>'Test',-script=>[{-type=>'javascr...

Cron job to put files on server

Let me start by saying that I know nothing about Cron, so sorry. How can I make a php or perl script get files from my computer and upload them to my web server everyday at midnight? The webserver is linux. The computer from which the files need to be retrieved is Windows. ...

Difference between differnet web programming frameworks?

I have experience programming dynamic websites using both php and perl driven CGI code, (both on apache web server on *nix systems, though that shouldn't matter). I do not have too much exposure to other technologies for web creation, but I frequently hear hailing and railing towards them from all forms of developers. (The most I've he...

Serving Python scripts with CGIHTTPServer on Mac OS X

I'm trying to set up Python's CGIHTTPServer on Mac OS X to be able to serve CGI scripts locally, but I seem to be unable to do this. I've got a simple test script: #!/usr/bin/env python import cgi cgi.test() It has permissions -rwxr-xr-x@ and is located in ~/WWW (with permissions drwxr-xr-x). It runs just fine from the shell and I ...