cgi

How do CGIs and Servlets execute differently?

My understanding is that a CGI spawns a separate executable process on the server each time but that a Servlet does not do that - but I'm not sure how to describe what happens with a servlet by comparison. Since the servlet exists inside the JVM and the JVM is a single process, where does the Servlet exist in relation to it? ...

Using CGI to Generate both XML and XSLT

Is it possible for the XML output of one CGI script to make use of XSLT output generated by another script? I ask mainly because I can't test it right now. Basically, I'd like to know if it's possible or valid for some page.cgi to produce: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="style.cgi?"?> <root> ... </root> ...

validating radiogroup with perl/cgi

Is it possible to validate a radio group (so something is checked off, or chosen) using server-side validation with Perl? If so, how? I already have it for JavaScript, but I want this form to be able to be submitted even without JavaScript enabled. Thus I will need the validation on the server-side. There is no fixed name for the radi...

Hosting Mecurial HG via VisualSVN Server

I have tried to host a Mercurial HG repository using a Scriptalias. ScriptAlias /hg/ "htdocs/hgwebdir.cgi" If I go to Chrome it display the contents of the cgi file. In IE it does render however images and links are not displayed. In either case the repository I want to display is not shown. Has anyone managed to get this working with...

How do I issue an HTTP redirect with Perl's CGI.pm?

Hello, I want to perform an HTTP redirect, but the way I am currently doing it isn't working. When I try redirect it just prints the status code, and the location header: my $q = new CGI; q->redirect(" http://www.google.com "); ...

How can my CGI program access non-browseable files?

I was wondering if it was possible to read a text file that was located in a directory called "/home/user/files" I wanted to read it from my cgi-bin which is located in /home/user/cgi-bi/ Below is my code, #!/usr/bin/perl use strict; use CGI; #Virtual Directory #Steffan Harris eval { use constant PASSWORD => 'perl'; use constant U...

CGI site , moscow ml problem

Hello , i'm using Moscow ML combined with CGI. I have a site that calculates simple arithmetics. When the submit button i pushed, the site is redirected to the actual CGI file that outputs the result of the calculation. Although in my case, it outputs the html code in raw form rather then actually outputting the result in html. Anybody t...

Why does my Perl CGI program fail with "Software error: ..."?

When I try to run my Perl CGI program, the returned web page tells me: Software error: For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error. Here is my code in one of the file: #!/usr/bin/perl use lib "/home/ecoopr/ecoopr.com/CPAN"; use CGI; use CGI::FormBuil...

Running a python script in background from a CGI

I have a python CGI which runs some script in the background and shows the stdout in the html page. I run the script when the user clicks some button in the page. My problem is when the script starts running the page becomes busy and the user can't use the other client side features in the page. What I want is: The script should run in...

Talking to printer from Python CGI

I have a Python CGI. I want to print the data in the page. There will be a print button and when the user clicks teh button, I need to do some processing and send the data to the printer. I similarly want to implement 'Export to excel'. Please let me know how to do these ...

How to parse POST data in a CGI script with BASH scripting?

Hi everybody I Have a cgi script written with bash and i have to read a POST variable sent to this file. I am not good at bash scripting so i really need this help. From a php script I send a POST variable named log_message to this cgi but i don't know how to parse the POST var from the header. Any help? ...

Why are my "+" characters turned into spaces in my CGI program that handles Ajax requests?

I'm collecting text through a web form and noticing that when it is collected by my Perl CGI all instances of "+" are transformed into " ". I run the text through a JavaScript escape before submission, but escape seems to leave + unaltered. There must be something really obvious that I'm missing... how do I send the string "2 + 2 = 4"...

Why cgi scripts have to stay in cgi-bin folder ?

Why cgi scripts have to stay in cgi-bin folder ? What is the difference from insert python script ( or php script or any other script ) in public_html folder and in cgi-bin folder ? I don't understand :-\ ...

Best/Fastest Way to Test Python CGI locally?

Just wondering whats the best way to test Python CGI while developing a site? (I'm used to PHP for web dev so bear with me :P) ...

How do I do a postback to a CGI service

I am building a C# client for a CGI service (not sure what its called exactly). It accepts a bunch of XML and spits out a response. I have tested it straight in Firefox and it works (see below). Now I am not sure how to do this in C# code though? Does anyone have a helpful snippet of code, I can't imagine it would be that difficult...

Why does my Perl CGI complain "Can't locate Mysql.pm"?

I have two folders php and perl. They contain index.php and index.pl, respectively. My Perl code looks like: #!/usr/bin/perl use Mysql; print "Content-type: text/html\n\n"; print "<h2>PERL-mySQL Connect</h2>"; print "page info"; $host = "localhost"; $database = "cdcol"; $user = "root"; $password = ""; $db = Mysql->connect($host, $dat...

What are all the standard CGI environment variables?

CGI scripts should have access to a list of environment variables set by the web server. What are their names? ...

Why does my Perl CGI script complain about "Can't locate CGI/Simple.pm"?

For more information see this Example use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; my $dsn = sprintf( 'DBI:mysql:database=%s;host=%s', 'cdcol', 'localhost' ); my $dbh = DBI->connect($dsn, root => '', { AutoCommit => 0, RaiseError => 0 } ); my $status = $dbh ? 'Connected' : 'Failed to con...

How should I redirect users in a formmail script?

So I'm using a basic formmail script. Within the script I'm using a redirect variable. The value of the redirect is something like: http://www.mysite.com/NewOLS_GCUK_EN/bling.aspx?BC=GCUK&amp;IBC=CSEE&amp;SIBC=CSEE When the redirect action happens however, the URL appears in the browser as: http://www.mysite.com/NewOLS_GCUK_EN/bli...

Adding objects to LDAP via CGI

I have a web form that collects information and submits it to a cgi that attempts to insert the data into LDAP. The problem is that I'm trying to use a variable with ::ldap::add and it's just not working. Here's the code: if {[string length env(QUERY_STRING)] != 0} { set handle [::ldap::connect localhost] set dn "cn=admin,dc=myc...