cgi

Determine record in multi record html form

In a html form, I'm displaying multiple records from a table, ready for update. Right now I use: name=<column-name>_<pk-id> value=<value> for the fields. Then in my python-script I go for: for key in form.keys(): if key.startswith('<name-A>_'): update <table> set <name-A> = <value> where pk=<pk-id> if key.startswith('<n...

How can I set Perl's inclusion path for modules for a CGI script?

Hello! I’ve got several Perl modules installed on my hosting machine in ~/perl, how do I add them to Perl module path? Setting PERL5LIB or unshifting the paths to @INC surely works, but the environment variable does not help when running as a CGI script and the @INC way is not very portable. Is there a better way? This has to be a common...

How do I serve an image from the cgi directory under Tomcat?

I have configured Tomcat 6 to serve Perl CGI scripts. That part is well documented and works ok for me. But, when a browser requests an image from this CGI dir, Tomcat's CGI servlet refuses to serve the image, displaying instead merely the url of the image. I believe this is a security feature to prevent users from seeing the contents ...

Best way to debug a Windows CGI

I have a Windows CGI created with Delphi 2007 using CGIExpert that I need to debug. Is there any simply way to run it from within the IDE while passing parameters to it? I tried setting the Host Application to iexplore.exe (Run|Parameters) and entering some text on the Parameters field but it just can't seem to pass any parameters at ru...

How can I run Perl scripts using FastCGI on Nginx?

So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps. I have a VPN (slicehost.com) with Debian Etch, serving a website (static so far) with nginx. I used wget to download FastCGI and I did the usual make make install routine. So I guess since FastCGI can't normally run CGI scripts you have...

Template Architecture with CGI

Hi, I have a web page that needs to display a sqlite database. Right now i am creating the entire page dynamically through CGI. However, I would rather have one html file and just populate a table within the file with the database content. What is the best method to do that? I am limited to html, javascript and CGI in C. Any help is gre...

LDAP Authentication using CGI+TCL

How can I authenticate a user with LDAP using CGI/TCL stack? Please provide a sample code-snippet if possible. I am using an Apache Web Server on RHEL 5.0; AD exists on a remote Win2003 server. ...

Looking for an easy templating solution with ruby

Hello, I am looking for a simple templating solution for ruby, i.e. something that will let me write php-like or jsp-like templates (html with embedded code tags), but in ruby. jsp is no good for me, because most hosting services (I'm on dreamhost) don't support it on their default package, and it's a little cumbersome to set up. php is...

Why can't Nginx POST to my Perl backend?

EDIT: So I just found out that GET methods indeed work, but POST methods however do not work! That might be significant. So I am on Debian Etch, running Nginx. Nginx does not normally serve cgi/pl files so I have followed a guide to get my backend working. http://technotes.1000lines.net/?p=23 My backend works fine on Apache but I had ...

CGI post handling differences on Hiawatha and Apache

I'm trying to set up a light development environment to allow straight CGI in Common Lisp, and I'd like to use Hiawatha instead of the much larger Apache. I have code that works for both GET and POST in Apache, but only GET in Hiawatha; is there a difference in the way Apache and Hiawatha handle POST? ...

Dispatch-like CGI Approach

Opinions: I want to disallow direct invocation of certain scripts, that have functionality accessible from a menu, via Web at the OS level (linux). I was hoping to call a authorize.pl script that checks the session validity, checks user privileges etc. Then it will redirect to the target script. Does this get around permissions? ...

How do you use the Apache "ScriptInterpreterSource Registry-Strict" directive?

i run Apache web server on windows in order to work on some Perl CGI scripts. in production these scripts run on a linux box, and in the source code repository they all have shebangs like: #!/usr/bin/perl, but on my windows machine the shebangs would be #!c:\perl\bin\perl.exe, so i have a conflict with the source code base. enter the Ap...

Are there Perl modules that can't be used in CGI?

I had a recent problem where Tie::File proved the best answer I could work with for a Perl program. I'm at a point where I'm ready to work with CGI, and I need to ask: are there Perl modules that can't be used in CGI, especially that Tie::File? If there are any complications, are there ways to reconcile them? ...

Apache giving a 400 Error on a FastCGI VirtualHost

Apache is spitting out a HTTP response of code: 400 "Bad Request" with no details whenever I access a page driven that is handled by a FastCGI script. I've installed the mod_fcgid module and it's loaded and configured in the Apache config files I've tested several FastCGI scripts, all of them run when directly executed. Static resource...

MoinMoin CGI and Query String Parameters

I've just chosen MoinMoin over TWiki to create a simple-but-robust web site. In addition to zero ramp-up and very basic authentication and Wiki features, I need to execute a few simple scripts that take the user's ID and email address as parameters. TWiki supported this with: [[/cgi-bin/mywiki/userscript?id=%USERNAME%&email=%USERINFO{...

Why does my Ajax request go directly from state 1 to 4?

Hello, I am making a request to a CGI program using AJAX. The response sends me content-length. My purpose is to dynamically exhibit the response progress. For that I need to start a function on onreadystate value of XHR object to be 3. But the request doesn't seems to acquire that status number. Instead it goes directly from state 1 to ...

How can I pass structured data to my (F)CGI through Apache?

We've got an apache module in place for authentication. If the user is able to authenticate, the REMOTE_USER environment variable is set to their username, where it's available to any CGI they access. I'd like to add a feature/module so that we can get additional information about the user from an LDAP data source and make it available...

What were the main disadvantages of CGI-BIN based web development?

I was fortunate enough to not do any cgi-bin .cgi based web development. But generally those who have do not seem to 'miss' those days. A project I recently joined has a performance issue when dealing with the pages that need to communicate to a legacy system that has a CGI-BIN based API. That system is COGNOS 7. The feedback I re...

Measure load time for python cgi script?

I use python cgi for our intranet application. When I measure time, the script takes 4s to finish. But after that, it still takes another 11s to show the screen in the browser. The screen is build with tables (size: 10 KB, 91 KB uncompressed) and has a large css file (5 KB, 58 KB uncompressed). I used YSlow and did as much optimizatio...

G-mail style form submission on table data

I have table rows of data in html being filled from a CGI application. I want each row to have a check box next to it so I can delete multiple rows, just like in gmail. I figured out the basic text form and was able to send it to the CGI program to delete the row, but I don't want to have to type in the row name to delete a single fil...