cgi

Tornado or Django works with CGI ?

Hi at all, Tornado is a webserver + framework like Django but for real-time features. On my server I don't have a python module or wsgi module so I thought CGI. Is there a way to get Tornado ( or Django ) works by using CGI folder ? If yes, Could you explain me how do I do that ? ...

How can I add file locations to a database after they are uploaded using a Perl CGI script?

I have a CGI program I have written using Perl. One of its functions is to upload pics to the server. All of it is working well, including adding all kinds of info to a MySQL db. My question is: How can I get the uploaded pic files location and names added to the db? I would rather that instead of changing the script to actually uploa...

How do you access the HTTP basic authentication username from perl?

I need to get the remote user name in my CGI script. Where do I find that? I want to display that name on the page that I return. ...

Python script to get the data from the flex application

Hi, I am making a simple Python CGI script that collects data(in xml format) from a flex application and I want to insert it into the mysql database . In perl The script is looks like the following... my @samplexml=$cgi->param("Items"); my $data=$xml->XMLin("@samplexml"); foreach my $e(@{$data->{Group}}) { my $sample="Insert int...

run .net consolapp out of a cgi script

Hello there, i have written a simple cgi python script which looks like this #!c:/Python25/python.exe -u import cgi import os def main(): print "Content-type: text/html\n" form = cgi.FieldStorage() print form["firstname"].value os.execvp("D:\\path\\to\\my\\consolapp.exe", [""]) main() As you can se i'd like to st...

Missing output when running system command in perl/cgi file

I need to write a CGI program and it will display the output of a system command: script.sh echo "++++++" VAR=$(expect -c " spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMD match_max 100000 expect \"*?assword:*\" send -- \"$PASS\r\" send -- \"\r\" expect eof ") echo $VAR echo "++++++" In CGI file: my $command= "ksh ../cgi...

http/html/ajax: show result before site is completely processed

I am looking for a way to show in a webapp in front of a task a wait-message and after it hide the message. The task is running a longer time. I dont know if it is possible at all. The problem is, so far I can see, that the site will be returned to the users browser AFTER the task is completed because the task is part of the site as a i...

multiple Perl ` print $cgi->header, <<HTML; .... HTML ` statement gives problem

i have something like: #!/usr/bin/perl use strict; use warnings; use CGI::Simple; use DBI; my $cgi = CGI::Simple->new; if ($cgi->param('selid')) { print $cgi->header, <<HTML; <br/>this is SELECT HTML } elsif ($cgi->param('delid')) { print $cgi->header, <<HTML; <b>this is DELETE</b> HTML } elsif ($cgi...

How to send web browser a loading page, then some time later a results page

I've wasted at least a half day of my company's time searching the Internet for an answer and I'm getting wrapped around the axle here. I can't figure out the difference between all the different technology choices (long polling, ajax streaming, comet, XMPP, etc.) and I can't get a simple hello world example working on my PC. I am runn...

How can I run my perl CGI script without apache?

How can I run my perl CGI script without apache? This is for testing purposes, so some kind of single-process server that processes only one request at time should be enough for me. ...

How do I receive and respond to Ajax requests in Perl?

I have a client-side appliction which submits some data via AJAX POST request (request.open("POST", url, flag)) to my Perl CGI script. How do I retrieve this data with Perl and return some other data (AJAX response)? ...

Run Python CGI Script on Windows XP

I have a Windows XP machine that has Apache installed via a VisualSVNServer installation. I am . trying to get a simple python cgi script to run in my browser e.g. http://build.procepts.com.au:8080/hg/cgi-bin/test.cgi. However despite trying all the recommended approaches the browser only ever displays the plain text from the cgi scrip...

Can I run my mod_perl aplication as an ordinary user

Can I run my mod_perl aplication as an ordinary user similar to running a plain vanilla CGI application under suexec? ...

Storing Data from both POST variables and GET parameters

I want my python script to simultaneously accept POST variables and query string variables from the web address. The script has code : form = cgi.FieldStorage() print form However, this only captures the post variables and no query variables from the web address. Is there a way to do this? Thanks, Ali ...

perl TemplateToolkit - Can't locate object method "new" via package

Hi, I have inherited a web project that is perl based and I'm attempting to set up a local testing server so changes can be made internally to the project. The server architecture Ubuntu 9.10 php 5.2.10 mysql 5.1.37 perl 5.10.0-24ubuntu4 All the dependent modules and packages are installed such as DateTime.pm, TemplateToolkit.pm but r...

CGI Perl script is printing the HTML (along with 'content-type: text/html') string to the browser rather than rendering it. How to fix?

I have a perl CGI script that needs to send back some HTML print qq^Content-type: text/html\n\n <HTML> <HEAD> <TITLE>some title</TITLE> ... ... ... ... ^: Instead of seeing the rendered HTML in the browser, I see the entire HTML along with the tags and the 'content-type' line in plain text. Below is how things look in the browser - C...

Perl open file problem

I am having some trouble trying to print from a file. Any ideas? Thanks open(STDOUT,">/home/int420_101a05/shttpd/htdocs/receipt.html"); #Results of a sub-routine &printReceipt; close(STDOUT); open(INF,"/home/int420_101a05/shttpd/htdocs/receipt.html"); $emailBody = <INF>; close(INF); print $emailBody; ERRORS: Filehandle STDOUT reop...

How to get IP address of your application server

I need to be able to find the IP address of the server the page is currently executing on. I have some code that calls a third party site and has to pass a specific key that changes depending on which server it is on. Is there a CGI variable or some way in ColdFusion to determine what the IP address is of the host server? ...

Are fopen/fread/fgets PID-safe in C ?

Various users are browsing through a website 100% programmed in C (CGI). Each webpage uses fopen/fgets/fread to read common data (like navigation bars) from files. Would each call to fopen/fgets/fread interefere with each other if various people are browsing the same page ? If so, how can this be solved in C ? (This is a Linux server, co...

How can I pass an HTML file content from PHP to CGI (Perl) Script

The content of the an HTML file generated by a PHP is stored in a string variable called $output I am trying to send the contents in $output to a CGI script. I have tried the following CURL in PHP... $output = "long string, with strange non HTML characters..." $c = curl_init(); curl_setopt($c, CURLOPT_URL, 'http://www.example.com/cg...