cgi

perl CGI radio_group: populate values from DB query

Im trying to dynmically generate a table that has a radio button per row whose value is set to the ID field of a SQL table. Im not sure how I can reference this value using CGI radio_group. In my research radio_group uses an associate array, however if I convert the SQL query to an associative array the values wont match up since there ...

What module can I use to parse RSS feeds in a Perl CGI script?

I am trying to find a RSS parser that can be used with a Perl CGI script. I found simplepie and that's really easy parser to use in PHP scripting. Unfortunately that doesn't work with a Perl CGI script. Please let me know if there is anything that's easy to use like simplepie. I came across this one RssDisplay but I am not sure about th...

How can call a PHP function from Perl code?

I have a function written in PHP and would like to call this inside a CGI script. Is there any direct way to do this? I am not sure if its even possible. The CGI script will be inside cgi-bin directory and the PHP function will be outside this folder. ...

Apache2 and CGI - how to keep Apache from buffering the POST data?

I'm trying to provide live parsing of a file upload in CGI and show the data on screen as it's being uploaded. However, Apache2 seems to want to wait for the full POST to complete before sending the CGI application anything at all. How can I force Apache2 to stop buffering the POST to my CGI application? EDIT It appears that it's act...

How to configure MAMP to serve perl CGI scripts (NOT localhost!)

I'm using MAMP-pro to serve my domain to the outside world. I'm not a very experienced sys-admin, though I've slogged my way through a few basic things. I know what apache is, and I can read-most-of but not generate-without-guide related .conf files. I've got a perl script which I've tested from the command line and it works (outputs ...

C CGI Program: how to print dynamically?

Hello I am new to CGI programming in C. What I'm looking to do is, per the title, print things dynamically. For instance, consider this code that prints out a bunch of numbers: int main() { long int l=0; printf("Content-Type: text/plain;charset=us-ascii\n\n"); while(1) { printf("%li ", l); if (...

How can I spawn a long running process in a Perl CGI script?

I'm writing a Perl CGI script right now but it's becoming a resource hog and it keeps getting killed by my web host because I keep hitting my process memory limit. I was wondering if there is a way I can split the script I have into multiple scripts and then have the first script call the next script then exit so the entire script isn't...

CGI download image after generating

I have a small python cgi script that accepts an image upload from the user, converts in into a different format, and saves the new file in a temp location. I would like it to then automatically prompt the user to download the converted file. I have tried: # image conversion stuff.... print "Content-Type: image/eps\n" #have also tried...

http POST by reading stdin (CGI in C)

Which is an error-free way to get a http POST in CGI in C? I'm currently using this. Is it ok? What if "CONTENT_LENGTH" is incorrect and is larger than stdin is; how will read behave then? char *STDIN = NULL; char *pointer = getenv("CONTENT_LENGTH"); if(pointer != NULL) { char charlength[5] = ""; strncat(charlength, pointer, 4...

WebSocket and CGI/FastCGI/SCGI protocols

Hello, I'm looking for resources about interaction between client side web socket, web server and real application backend that works behind CGI, FastCGI or SCGI protocols. It seems that this is impossible at this point as: Request length is specifically defined in CONTENT_LENGTH variable so I can't expect that the data would continue...

Limit the rate of requests to an API in a CGI script

The script that I'm writing sometimes makes requests to an API and the API requires that requests are limited to a maximum of 1 per second. What is the most straight forward way of limiting my requests to the API to 1 every second? Would it involve storing the current time in a file each time a request is made? ...

How to configure CGI on IIS 7 ?

I did this as explained here but it was for IIS 6 http://rebolforum.com/index.cgi?f=printtopic&topicnumber=39&archiveflag=new I also activated 32 bits for application pool as explained here http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx But when browsing to the test script it doesn't work, seems to...

Shell Script For The Web

I want to know if there is any way to use Bash(Shell Script) to make web pages, like Perl, C++ and others through CGI. And if there is any way, where I can find a good free hosting for it? ...

How to execute CGI from .Net using query_string environment

I am trying to get this API working: http://wiki.openstreetmap.org/wiki/Gosmore#Cgi_Routing_Interface Gosmore is installed and I've tried to execute it using this code: Dim proc As New ProcessStartInfo proc.EnvironmentVariables.Add("QUERY_STRING", "flat=57.69819&flon=11.97485&tlat=57.69819&tlon=11.97490&fast=0&v=motorcar") proc.Fi...

Session management via pure CGI

I'm currently in the process of writing a little blog / generic posting system using CGI in C as a hobby project and am now in the need of a session management system to authentificate authorized users for posting, editing and similar operations over multiple CGI programs From working with PHP years ago I remember using the superglobal ...

Reading CGI POST data the most efficient way

I'm in great need of a way to dig through potentially huge amounts of CGI supplied POST data. With reading the GET data it's no big deal, as I can just re-request the QUERY_STRING environment variable as often as I want, but with POST data which is supplied via stdin. I can only read it in once and have to store it somewhere. My curre...

just can't get perl working as expected ( conditionals and variable declaring )

EDIT: I will try a better explication this time, this is the exact code from my script (sorry for all them coments, they are a result of your sugestions, and apear in the video below). #use warnings; #use Data::Dumper; open(my $tmp_file, ">>", "/tmp/some_bad.log") or die "Can not open log file: $!\n"; #if( $id_client != "") @allowed_lo...

CGI IDE on Windows

Is there a way to use NetBeans or Eclipse for an old Perl CGI application in a Windows environment? I currently have NetBeans for PHP. NOTE: I am a .NET dev and have done PHP back in the day. I know very little about CGI, I just need to modify an existing legacy app. ...

Python file upload "KeyError"

Hi, Whats wrong in this code? Here is my HTML: <html><body> <form action="iindex.py" method="POST" enctype="multipart/form-data"> <p>File: <input type="file" name="ssfilename"></p> <p><input type="submit" value="Upload" name="submit"></p> </form> </body></html> This is my Python script: #! /usr/bin/env python import os, sys; from mo...

Base64.decode64 in ruby returning strange results

Hi all, I'm having problems in decoding a string using Base64.decode64 in Ruby. As a test, I'm using this site that decodes strings in php: https://rnd.feide.no/simplesaml/module.php/saml2debug/debug.php. As a test, I'm using this string: fZJNT%2BMwEIbvSPwHy%2Fd8tMvHympSdUGISuwS0cCBm%2BtMUwfbk%2FU4zfLvSVMq2Euv45n3fd7xzOb%2FrGE78KTRZXw...