cgi

Pass variables from htaccess to bash script

Hi, I'm trying to pass the value of a cookie to a bash script: RewriteCond %{HTTP_COOKIE} mycookie=(.*) [NC] RewriteRule .* script.sh?cookievar=%1 ... but can't seem to find out how to read the GET variable in the bash script. (I suppose I'm asking Google the wrong queries, but can't find any info on this). Is this even possible, an...

How can I communicate across Perl CGI scripts?

I am searching for efficient ways of communication across two Perl scripts. I have two scripts; Script 1 generates some data. I want my Script 2 to be able to access that information. The easiest/dumbest way is to write the data generated by Script 1 as a file and read it later using Script 2. Is there any other way than this? Can I st...

How can I invoke /sbin/iptables from a Perl CGI under taint mode?

When I invoke "sudo /sbin/iptables ..." in my Perl CGI scripts, I get the error: Insecure dependency in system while running with -T switch at usr/lib/perl5/vendor_perl/5.8.8/IPC/Run3.pm line 403 I tried to add "/sbin:/etc/sysconf:/etc/init.d" in $ENV{'PATH'} but still no success. Anybody has any idea? ...

getenv(QUERY_STRING) in C CGI

C file: #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv[]) { FILE *ptr; char m[200]; char *data = malloc(200); data=getenv("QUERY_STRING"); sscanf(data,"%s", m); printf("%s", m); ptr=fopen("c:/test.txt", "w"); fprintf(ptr, "%s", m); fclose(ptr); return 0; } //gcc -g print.c -o print.exe HTML ...

How to parse $QUERY_STRING from a bash CGI script.

I have a bash script that is being used in a CGI. The CGI sets the $QUERY_STRING environment variable by reading everything after the ? in the URL. For example, http://example.com?a=123&amp;b=456&amp;c=ok sets QUERY_STRING=a=123&b=456&c=ok. Somewhere I found the following ugliness: b=$(echo "$QUERY_STRING" | sed -n 's/^.*b=\([^&]*\)....

Deactivate time-limit in php.ini for cgi-php

What does this mean? deactivate time-limit in php.ini for cgi-php What is time-limit in php.ini? What is cgi-php? ...

Avoiding CGI timeout

I have a function, that gets a large XML file, then parses it, and then uses the details, to get some more xml files, that are again parsed ( A webshop). The problem is, that the processing takes about 15-20mins, but the script timeout's before that, and sends me a 500 error message. Is there a way around this? I read on a post here...

How can I track users and other web stats in a Perl CGI program?

I have this internal website within a company and it's Perl CGI based. I would like to install some kind of system to track users and other web statistics. Any recommendations on how to do this? I would like to have full control and allow easy to install. ...

Using Actinic V8 and having a problem with Path to Perl and Perl Script Extension. Any help would be great.

Hi there, I am using Actinic v8 and having a problem locating the path to Perl. I am getting this message popping up and I just don't know what to do to solve it. The wizard needs to know where Perl is installed on the web server and what extension Perl scripts must have in order to execute on the remote server. You may need to cont...

IE performance for rendering huge html data

I have a few perl CGIs which almost query the whole table with more than 5000 rows as result and send that data to browsers. The size of html data generated is around 1MB. Earlier I was using tables(which should be ideal approach). Unfortunately most users use IE and it does not display data till it receives closing table tag. Can we d...

How can I run a long background process from a Perl CGI program?

I have a problem with a long running CGI and the timeout error: Timeout waiting for output from CGI script The client side is a form programmed in jQuery. The user input some data and receives a message that the analyses has been launch. The user don't expect to see receive more messages except an email with a link when the data h...

Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python?

I'm just wondering what the differences and advantages are for the different CGI's out there. Which one would be best for python scripts, and how would I tell the script what to use? Thanks! ...

how to find out whether website is using cookies or http based authentication

I am trying to automate files download via a webserver. I plan on using wget or curl or python urllib / urllib2. Most solutions use wget and urllib and urllib2. They all talk of HHTP based authentication and cookie based authentication. My problem is I dont know which one is used in the website that stores my data. Here is the interact...

How do I invoke a Perl CGI script when the user requests an HTML page?

Is there anyway to invoke a Perl CGI script when an HTML page is requested to server? Just like a script can be tied to an action, is there anyway to tie a script to "Request for page" ...

How do I create a link on an image in a CGI script?

I can successfully show image in my CGI scripts via CGI.pm, using this code: #!/usr/bin/perl -w use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; print img {src => "../images/myimage.png", align=>"CENTER"}; However when I want to do is to include URL in that image, wo that whenever people click on that image it will point to...

How can I output a large HTML table in a Perl CGI program without freezing the browser?

I have this Perl CGI program and I allow the user to select the number of data to view on this HTML table. I go through a foreach ... foreach ... and print each row. There is an issue with the Perl CGI script when it prints over 3,000 rows of data and my Firefox window becomes unresponsive. I am also linking dataTable jquery. What app...

GAE CGI: how to response http status code

I am using google appening, it's CGI environment. I want block some request, I want response nothing even no http status code. Alternative, I want just close the connection. Can I do this? update: I have decide to use what pyfunc said, use 204 status, but how can I do this at GAE CGI environment without any webframework. update 2: T...

How to answer a 501 Exception from Apache without Response Header?

I need to access the header to implement methods for a self written client on a mobile phone. The page should be accessible from J2ME without complete Request/Response Headers (Uses less traffic. For Example: J2ME sends only "G i\r\n\r\n"). Is there a way to get this working? (no matter how) ...

How to avoid refresh in AJAX?

Hi, I have a client and a server written in CGI(c++), as JS model is like to ask something from server, there is no mechanism for server to send async message. So this means the client needs to poll server periodically? I read BOSH protocol, it says to achieve the async for http, a web page can issue several HTTP request, but the server...

How can I assign different actions to same html form ?

I am trying to assign different actions to same html form according to different submit buttons. Can I do something like this ? <FORM> ------ <INPUT type="submit" value="DoSomething" action="DoSomething.pl" method="POST"> <INPUT type="submit" value="DoSomethingElse" action="DoSomethingElse.pl" method="PO...