cgi

How do I cause a CGI program to run when someone clicks on a button?

I have a Perl CGI program in which I designed an HTML form. If somebody clicks on a button in this form, a CGI/Perl subroutine in this file is executed. Because I have more than one buttons in the form, I set their types as "Button", not "Submit". This is a bookstore website, I have three buttons each for a kind of books (for example,...

How can I change a rowspan attribute within my CGI program?

Hello, I am writing a CGI script that will process form data, and it should print the name of the input, along with its value, in a table. When I have one or more values with the same name, the name should span rows to accommodate all values that correspond to that name. For example, if I have a name "color" with its values at "red", "gr...

How can I redirect to a "Processing..." page while my CGI program is working?

I am trying to write a Perl script that takes data from a user, creates a HTML file on the basis of that data, redirects to this HTML file and then performs some computations. The problem I am facing is that the browser does not redirect to the new HTML page unless the computations are completed. Please suggest a solution. ...

Why is this Perl CGI script failing to upload images correctly?

I have this code: use CGI; use File::Basename; use Image::Magick; use Time::HiRes qw(gettimeofday); my $query = new CGI; my $upload_dir = "../images"; #location on our server my $filename=$query->param("img"); my $timestamp = int (gettimeofday * 1000); my ( $name, $path, $extension ) = fileparse ( $filena...

Rewriting rails url from port 3000?

i have an applicaiton that runs at actionengineers.com:3000. How do i reqwite the application to a subdomain or directory (actionengineers.com/myapp) without disturbing the main site of course. i tried to use .htaccess file but i allways get eror 404. here is the code in the .htaccess file. RewriteEngine on RewriteCond %{HTTP_HOST} ^www...

[Perl] After querying DB I can't print data as well as text anymore to browser

I'm in a web scripting class, and honestly and unfortunately, it has come second to my networking and design and analysis classes. Because of this I find I encounter problems that may be mundane but can't find the solution to it easily. I am writing a CGI form that is supposed to work with a MySQL DB. I can insert and delete into the DB...

Remotely restart a linux service from local Windows or Mac machines

Sometimes my media server does not update its database, the only way to fix it is to restart the daemon. I would like users to be able to simply run an executable or script to do so without revealing any login information to them (which might result in inadvertent headaches). I feel the easiest way to do this would be to have an exec...

Why does my CGI::Session keep emptying itself randomly?

The session loads fine for the most part but it is randomly clearing all of the data some times and I don't know why: Create my new session: $session = CGI::Session->new( "driver:file",undef,{Directory => '/tmp'} ); $session->param('logged_in', 1); $session->expire('logged_in', '+10m'); $session->expire('+1h'); Now when I go to ano...

Is there a good reason why I shouldn't be mixing POST and GET parameters in a CGI query?

Is there a good reason why I shouldn't be mixing POST and GET? For example: <form action="http://example.com/?param1=foo&amp;param2=bar" method="post"> ...

How does the COMSPEC environmental variable effect a cgi executable?

It appears that a cgi app (in C, VS C++) does not inherit the COMSPEC environmental variable. When adding the variable to the application: _putenv( "COMSPEC=C:\\WINDOWS\\system32\\cmd.exe" ); // C4996 the cgi application no longer executes from the browser but is interpreted as a file for download. (i.e. - Save this file?) My quest...

Why do I get assembly bind failure in IIS CGI program

I have a C# program that is running as a CGI app in IIS on XP Pro SP3. It runs fine until I reference a library assembly class and use it in the program's code. If I run the CGI program by hand it loads and executes. But when it is run by IIS the referenced assembly fails to bind despite it being right in the same directory as the parent...

Passing CGI parameters to a form via an URL

Hello everyone! I am trying to pass arguments to this CGI form (http://www.westegg.com/inflation/) through the URL, so I don't have to manually type them in, and so that I can generate URLs through other means for faster use. Here is the CGI form code from the site: <form action="infl.cgi" method="post"> Enter the amount of money: <i...

mod_rewrite with location-based ACL in apache?

Hi. There is a CGI-script that provides some API for our customers. Call syntax is: script.cgi?module=<str>&func=<str>[&other-options] The task is to make different authentiction rules for different modules. Optionally, it will be great to have nice URLs. My config: <VirtualHost *:80> DocumentRoot /var/www/example ServerNa...

Is there a way to execute a .exe CGI application on Linux + Apache

I have to migrate a web server from Windows + IIS to Linux + Apache, but there are some webpages rely on .exe CGI applications (some financial calculators) to generate the outputs. Is there an easy way to get this job done? BTW, I don't have the access to the source code of those .exe file. Even though I have, it would take a long time...

How can I get $cgi->state to return meaningful information under HTTP::Server::Simple?

First, here is the code I am using (you'll need version 0.42 of HTTP::Server::Simple to run it): #!/usr/bin/perl package My::HTTP::Server; use strict; use warnings; use parent 'HTTP::Server::Simple::CGI'; sub handle_request { my $server = shift; my ($cgi) = @_; print $cgi->header('text/plain'), $cgi->state, "\n"; } packa...

HTTP POST Requests require multiple transmissions?

I found the quoted text in Programming Python 3rd edition by Mark Lutz from Chapter 16: Server-Side Scripting (page 987): Forms also include a method option to specify the encoding style to be used to send data over a socket to the target server machine. Here, we use the post style, which contacts the server and then ships it a strea...

Encoding minimum characters in POST request: is it safe or not?

I came across an approach to encode just the following 4 characters in the POST parameter's value: # ; & +. What problems can it cause, if any? Personally I dislike such hacks. The reason why I'm asking about this one is that I have an argument with its inventor. Update. To clarify, this question is about encoding parameters in the POS...

Including perl cgi scripts in html

Hi, I want to write a header and footer perl scrip that will return the headers and footers of my individual webpages. I was assuming I would do some sort of include of that file in the part of the html file I want it to appear. Is that the way I should go about this, if so how do I do that? If anyone has any other suggestions for bet...

Problems with CGI wrapper for PHP

I'm having a bugger of a time with a CGI wrapper for PHP. I know very little about CGI and PHP as CGI. Here's what I know about the system: Solaris 10 on a 386 Suhosin PHP normally running as CGI, with cgiwrap (http://cgiwrap.sourceforge.net/). I am not able to find an example wrapper.cgi on the server to look at. Shared hosting (vi...

configuring apache with webdot

Hi, I would like to automatically generate image from *.gv files in a browser. I am using webdot CGI script to do this. This works with URLs like these: http://localhost/cgi-bin/webdot/path_to_file/file.gv.dot.png location of the CGI script: http://localhost/cgi-bin/webdot/ file to render: /path_to_file/file.gv rende...