cgi

I want to create a "CGI script" in python that stays resident in memory and services multiple requests

I have a website that right now, runs by creating static html pages from a cron job that runs nightly. I'd like to add some search and filtering features using a CGI type script, but my script will have enough of a startup time (maybe a few seconds?) that I'd like it to stay resident and serve multiple requests. This is a side-project...

How do I structure my Perl CGI program?

We just got our first major Perl CGI assignment in my CS class. Our task is to create an mp3 sharing site that allows users to create accounts, log in, share mp3's. Statistics must be shown of current users, mp3's available, etc. All actions must be written to a log file. Our code must be secure. So far, I have implemented each of th...

how do you detect CGIproxy ?

i have cgiproxy (http://www.jmarshall.com/tools/cgiproxy/), which lets users use it to navigate pages. it seems like myspace.com detects it and forwards the user to google.com doing a quick test to determine my ip using the proxy fails, meaning it doesn't reveal my ip. it shows proxy server's ip. <?php if (getenv("HTTP_X_FORWARDED_FO...

same cgi proxy script behaves differently in 2 different servers.

i have one dedicated server and one shared hosting server. i download and put both cgi proxy script in /cgi-bin/ these two files are identical. on both servers, i checked that there is no cookies recorded by cgiproxy. virgin. URL flags are all same. i navigate to myspace.com Behavior Difference: dedicated server's cgi proxy redir...

What web servers use `COOKIE` instead of `HTTP_COOKIE`?

In the source code of the Perl module CGI.pm, in the submodule CGI::Cookies.pm, there is the following line: $raw_cookie = $ENV{HTTP_COOKIE} || $ENV{COOKIE}; I'm interested in $ENV{COOKIE} here. Are there any web servers (obsolete or otherwise) which transmit cookie information using the COOKIE environment variable instead of the HTTP...

How do I display real-time python script output on a website?

I have a Python script that outputs something every second or two, but takes a long while to finish completely. I want to set up a website such that someone can directly invoke the script, and the output is sent to the screen while the script is running. I don't want the user to wait until the script finishes completely, because then a...

Flex and CGI Newbie: How do I get them to talk

Hey guys, I am a Flex developer and never used CGI before. I wanted to create a solution whereby A flex would call a CGI script to read a database. Ive been trying to look for examples on how such a solution would work. I was hoping someone on here might be able to shed some light as to how this would work, and what are the various comp...

How to access a $_POST item through the following array kind of syntax?

If i send four POST variables, but the second one I dont know that the name="" tag will be; how can I access it? Can i use $_POST[1] or not? ...

How do I raise an http error/exception from a python CGI script?

How do I raise an http error/exception from a python CGI script? Is all that is necessary is to print the appropriate header: print '''Status: 501 Not Implemented Content-type: text/html ''' That doesn't seem to work right. I have a very basic setup, namely IIS7 routing *.py CGI scripts to python25.exe for execution. I am not using...

How can I continuously inform the user of progress from a Perl CGI script?

I have this Perl script sitting in the cgi-bin folder of my Apache server: #!/usr/bin/perl use strict; use warnings; $| = 1; print "Content-type: text/html\r\n\r\n"; print "Hello there!<br />\nJust testing .<br />\n"; my $top = 5; foreach (1..$top) { print "i = $_<br />\n"; sleep 1; } What I want to achieve here is a gradu...

apache: cgi links lead to a "you have chosen to open foo.cgi", although scriptalias is set

Following this guide on CentOS 5.2, just getting nagios set up for the first time. The main page shows up just fine, but when I try to view any of the pages that should be generated by a cgi process, firefox prompts me to save the .cgi instead, so apache's obviously not understanding that it needs to run the cgi and get back some html f...

Write binary data to stdout in c#?

I'm trying to write a quick cgi app in c#. I need to get to the stdout stream and write some binary data. The only thing I can find to do this is Console.Write, which takes text. I've also tried Process.GetCurrentProcess().StandardOutput.BaseStream.Write which doesn't work either. Is this even possible? ...

Is there a working example of simple Net::OpenID::Consumer::Lite CGI script?

I have seen the examples of Net::OpenID::Consumer::Lite on CPAN but I was hoping to get a single script that uses POST method. If nobody has this than I will post my solution back here once I get it working. ...

Why doesn't my Refresh header work?

Hello stackoverflow, I'm working on a homework assignment in Perl CGI using the CGI.pm module. In my code I am checking for a cookie. If the cookie exists, I want to initiate another CGI script. In other situations I was able to use similar code, but in this instance I merely get the following browser output, not the redirect that I w...

What is a better way to stream audio with Perl CGI?

Stackoverflow: For a cs assigment I am using the following code to stream audio. However, now I would like to add the ability to stream files successively, as in a playlist, how can I modify my code to accommodate this? I would like to have a text file of filenames that my script passes through sequentially streaming each. Is this ...

Security or other gotcahs in Apache-CGI-Bash application?

I've taken over supporting a time- and expense-entry system. Apache's CGI. CGI programs are written in bash :) I'm going to add some features into it and exposing it out to many more users, but prior to that wanted to get some thoughts on what else needs to be looked-at first in terms of security, holes, CGI gotchas, &c. Not a lot of...

Forward one domain to another based on request header.

Hi All, I have a requirement that I want to check the request headers and according to that I want to forward the incoming request to appropriate sub domain of my company. For example: request header A is coming then it goes to a.domain.com always (no matter request comes to a.domain.com or b.domain.com) Similarly request header B is...

How do I use a Perl CGI locally without using curl and apache2?

I would like to submit a form to a CGI script localy (w3c-markup-validator), but it is too slow using curl and apache, I want to use this CGI script more than 5,000 times in an another script. and currently it takes more than one hour. What should I do to give the form directly to the CGI script (I upload a file with curl)? edit: It se...

How do I prevent duplicate headers when dealing with threads in PHP?

I've written a PHP script that has to fork and do some processing in parallel, and then the main page returns data after processing. I'm currently using the pcntl functions to do this. I need to run anywhere between 2 and 10 threads to work in parallel, and I have to wait until I get a result from all of the threads before the script out...

HTTP POST Error 414

Hi there, I'm using HTTP POST to call a cgi script on a web server and send along some data as arguments. Some of the arguments can contain quite a bit of data. This seems to be a problem for the web server and I am getting error 414 (Request URI too long) as a result. My URI ends up looking something like this: http://somewebsite.com...