cgi

Finding out event that called a CGI script

What I want is to be able to make my CGI script do different things depending on what action initiated the calling of the script. For example, if one button is pressed, a database is cleared. If another button is pressed, a form is submitted and that data is added to the database. Should I be doing something like adding the name of the...

How can I send multiple images in a server push Perl CGI program?

I am a beginner in Perl CGI etc. I was experimenting with server-push concept with a piece of Perl code. It is supposed to send a jpeg image to the client every three seconds. Unfortunately nothing seems to work. Can somebody help identify the problem? Here is the code: use strict; # turn off io buffering $|=1; print "Content-type: mu...

Why does my Perl CGI script cause a 500 internal server error?

I get a 500 internal server error when I try to run the code below in a web server which supports perl: #! /usr/bin/perl use LWP; my $ua = LWP::UserAgent->new; $ua->agent("TestApp/0.1 "); $ua->env_proxy(); my $req = HTTP::Request->new(POST => 'http://www.google.com/loc/json'); $req->content_type('application/jsonrequest'); $req->con...

How to query a CGI based webserver from an app written in MFC (MSVC 2008) and process the result?

Hi, I am exploring the option of querying a web-page, which has a CGI script running on its end, with a search string (say in the form of http://sw.mycompany.com/~tools/cgi-bin/script.cgi?param1=value1&param2=value2&param3=value3 ), and displaying the result on my app (after due processing of course). My app is written in MFC C++...

Can you embed PHP code in the output of a CGI script?

I have a CGI based form that I am working with and I would like to be able to include some PHP code in the generated results. However, when I do this, the PHP does not appear to get processed and just ends up being displayed in the resulting web page. Is what I am doing actually possible or am I missing something? Thanks. ...

What exactly is a web application framework?

I'm getting into python for cgi and came across Django. I'm not quite sure I understand it very much. Is it something I have to install inside apache or is it just something I can use with my cgi? Wanted to know because I'd love to learn it but my server I'm using doesn't give me a lot of privileges. thanks ...

Why is Perl commonly used for writing CGI scripts?

I plan to add a better search feature to my site, so I thought that I would write it in C and use the CGI as a means to access it. But it seems that Perl is the most popular language when it comes to CGI-based stuff. Why is that? Wouldn't it be faster programmed in C or machine code? What advantages, if any, are there to writing it in a...

Configuration file for PHP server script

Right now I have a very high volume of requests coming to my webserver which execute a PHP CGI script. Every one of these scripts opens up a config file that I have created to load options of how the script should run. Doing a file I/O operation everytime a request comes in seems very resource intensive to me. I'm not too familiar with...

Passwordless SSH using cgi-perl script

Hello, This is my first shot at trying out cgi-perl scripts. I have SSH keys set up between my (root user) local machine and a remote machine. I'm trying to run a command on the remote box and display the output on a webpage hosted from my local machine. The script runs fine from command line however, it throws SSH key error when called...

changing file extension in python

Suppose from index.py, i have post file #####.fasta to display file. I want to change ####.fasta file extension to ####.aln in display file. How can i do it? I am working right now on python cgi. Thanks for listening ...

File Sharing Site in Python

I wanted to design a simple site where one person can upload a file, and pass off the random webaddress to someone, who can then download it. At this point, I have a webpage where someone can successfully upload a file which gets stored under /files/ on my webserver. The python script also generates a unique, random 5 letter code that ...

How do I get code coverage of Perl CGI script when executed by Selenium?

I'm using Eclipse EPIC IDE to write some Perl CGI scripts which call some Perl modules that I have also written. The EPIC IDE lets me configure a Perl CGI "run configuration" which runs my CGI script. And then I've got Selenium set up and one of my unit test files runs some Selenium commands to run my cgi script through its paces. But...

Should I write small CGI scripts or a big, monolithic script?

I am working on to create a web site to display some information about my system. This includes some graphs and some text information. For now I am creating different CGI scripts and calling them by creating links. A few days back one of my friends told me that instead of writting different CGI scripts, it's better to write single CGI sc...

Hide script extension

I have a html form that posts to a python script test.py. If someone tries to access the script directly, it redirects them to the form. I not using a web framework, just straight python cgi programming. My website is hosted on a shared hosting provider that allows me access to a .htaccess file. I wanted to know if there was a way to h...

Ajax to read file created by CGI

Any one here used C based CGI?? I have this server side code : while (cgiFormFileRead(file, b, sizeof(b), &got_count) == cgiFormSuccess) { fwrite(b,sizeof(char),got_count,output); i++; if(i == inc && j<=100) { fprintf(fptr, "%d" ,j); fseek(fptr, 0, ...

IP address of domain on shared host

I have domain on a shared hosting provider. How do I find the direct IP address of my domain using Python? Is it possible to post to a script on my domain using the IP address and not the website itself? Thanks. ...

File upload progress bar

Anyone who has developed file upload progress bar with following: Ajax Javascript HTML C based CGI I am stuck at one point. I am not able to read each updated progress bar value from CGI script. /*****************CLIENT SIDE CODE*************************/ var intervalID; var percentage; var request; var tempvar=0; var progress; fun...

Ajax based progress bar

I am developing a progress bar using Ajax. My client side code is working fine, but I have issue at server side. I am using C based CGI. if(i == inc && pb_inc<=100) { fptr = fopen("progress_bar.txt", "w"); fprintf(fptr,"%d", j); fclose(fptr); pb_inc++; } basically I am increasing progress bar after certain number of bytes. What I see ...

php cgi htaccess

i try to execute cgi but failed. i include following lines in .htaccess AddHandler cgi-script .cgi Options +ExecCGI abc.com/ is equivalent to the /home directory abc.com/compare is equivalent to the /home/compare directory abc.com/compare/contact is equivalent to the /home/compare/contact directory .htaccess file located in contac...

SSI not producing output, not giving error either.

in the html file: <!--#exec cgi="/cgi-bin/test.pl"--> the perl script: #!/usr/bin/perl print "Content-Type: text/html\n\n"; print "<input type=\"hidden\" name=\"aname\" value=\"avalue\">\n"; print "<img src=\"/cgi-bin/script.pl\" />"; This does not give me an 'error processing directive' error, nor does it output my HTML inplace of...