cgi

How do you see the client-side URL in ColdFusion?

Let's say, on a coldfusion site, that the user has navigated to http://www.example.com/sub1/ The server-side code typically used to tell you what URL the user is at, looks like: http://#cgi.server_name##cgi.script_name#?#cgi.query_string# however, "cgi.script_name" automatically includes the default cfm file for that folder- eg, that ...

Why doesn't this jQuery.post work with Perl CGI?

I'm trying to figure out why I'm not seeing params with $.post("/url/", {wtf: 2}). I'm using this perl: use strict; use CGI; my $cgi = new CGI; print $cgi->header("text/javascript"); print "'no'"; use Data::Dumper; warn Dumper({ (map {$_=>$cgi->param($_ )} $cgi->param), postdata=>$cgi->param("POSTDATA") }); When I issue a $.get("/u...

What is the best way to generate XML from a C based CGI application using the SQLite API?

Learning the basics of XML for the first time from W3C tutorials. How are most XML files generated? Does the server side application usually print a complete XML file to be parsed each time there is new data? I have a CGI application in C and it includes the SQLite API. Is the best way to do some sort of printf to a XML file (using my ...

How to force apache requests to use CGI WITHOUT the use of .htaccess

My school internal webserver is still running PHP v4.. (Not sure exactly). I went ahead and wrote all the labs and assignments on my local machine, which is running 5.2.5. Now, none of my code works on the school machine because the functionality simply is not there. I have access to a slew of compilers, and have downloaded the PHP v5...

HTTP Status 503 - Servlet cgi is currently unavailable

Yes, i dont know why tomcat is telling me my CGI is not available :( Anyone got any bright ideas? # HTTP Status 503 - Servlet cgi is currently unavailable type Status report message Servlet cgi is currently unavailable description The requested service (Servlet cgi is currently unavailable) is not currently available. Apache Tomcat...

How can I simulate a hung web service?

I'm trying to test out modes of failure for software that interacts with a web service, and I've already had reported issues where problems occur if the software doesn't get a timely response (e.g., it's waiting a minute or longer). I'd like to simulate this so that I can track down and fix issues myself, but unplugging the network conne...

.cgi problem with web server

The code #!/usr/bin/env python import MySQLdb print "Content-Type: text/html" print print "<html><head><title>Books</title></head>" print "<body>" print "<h1>Books</h1>" print "<ul>" connection = MySQLdb.connect(user='me', passwd='letmein', db='my_db') cursor = connection.cursor() cursor.execute(“SELECT name FROM books ORDER BY pub...

Privilege Escalation in Web Environment for File Access

I have a situation where I would like to elevate the permissions I have in a web environment so that I can access a serial device. The specific case is where I have a web interface for configuring a modem that comes up on /dev/ttyUSB[0-9]. Zero or more modems will be plugged in by an end user. I am writing some software that is capab...

Why avoid CGI for Python with LAMP hosting?

I have been using PHP for years. Lately I've come across numerous forum posts stating that PHP is outdated, that modern programming languages are easier, more secure, etc. etc. So, I decided to start learning Python. Since I'm used to using PHP, I just started building pages by uploading an .htaccess file with: addtype text/html py add...

Unable to call system commands and shell scripts from PHP Fedora 10

I am working on an application that runs locally on a Fedora 10 machine through PHP and Apache. It depends on a process that runs in the background. The higher-ups want to be able to start/stop/restart the process, through the browser. I was trying to get this to work by having PHP make calls to the system using exec() and shell_exec,...

Windows loginID help on Windows/Apache2.2 environment

Hello Apache/Win Masters: I really could use some help in solving what appears to be a trivial issue. In summary, I want to know the Window's loginID for the user accessing a Perl .cgi running in Apache on a Windows environment. Here's my basic Apache2 conf additions: ---- begin httpd.conf ----- ... LoadModule sspi_auth_module modu...

Can I write Python web application for Windows and Linux platforms at the same time?

Can I write web application that I can host on Windows(IIS web server) and Linux (Apache or lighttpd) without any changes? CGI? Maybe something new? WSGI | FastCGI ? ...

Need a http server with some specific criteria

Hi everyone, I've been looking for a webserver for my project but I haven't been able to satisfy myself. I need a http server that has support for compiled CGI scripts (exe), for Windows, and must be able to use relative paths. It would be a bonus if the server could be a minimal/lightweight as possible. The hardest part in my search th...

What are alternatives to SQL database storage for a web site?

An SQL database is overkill if your storage needs are small. When I was young and dumb, I used a text file and flock()ed it when I needed to access it. This doesn't scale, but I still feel that non-database solutions have been completely ignored in Web 2.0. Does anyone not use an SQL database for storage? What are the alternatives? ...

How can I reduce Perl CGI script start-up time?

I'm developing some CGI scripts and I'm trying to find a solution to decrease the "starting time" produced when I import a lot of modules with "use". ...

How can I limit file types in CGI file uploads in Perl?

I am using CGI to allow the user to upload some files. I just want the just to be able to upload .txt or .csv files. If the user uploads file with any other format then I want to be able to put out an error message. I saw that this can be done by javascript: http://www.codestore.net/store.nsf/unid/DOMM-4Q8H9E But is there a better way...

How can I make an AJAX server side script in C?

I am looking into AJAX for the first time and I would like to know if it's possible to make the requests from a server side CGI application written in C? Will the C application just use printf for the data, similar to this .asp example? ...

Launching a .py python script from within a cgi script

I'm trying to launch a .py script from within a cgi script while running a local cgi server. The cgi script simply receives some data from Google Earth and passes it to the .py script which is currently being called using execfile('script.py') placed at the end of the cgi script. The script runs to completion, however script.py contains...

Seting up Python on IIS 5.1

Hello, I have this test python file import os print 'Content-type: text/html' print print '<HTML><HEAD><TITLE>Python Sample CGI</TITLE></HEAD>' print '<BODY>' print "<H1>This is A Sample Python CGI Script</H1>" print '<br>' if os.environ.has_key('REMOTE_HOST'): print "<p>You have accessed this site from IP: "+os.environ["REMOTE_H...

What do I do after printing HTML in my Perl CGI script?

What should you call after printing HTML from a Perl CGI script? I have seen empty return statements, exit statements, and in some cases nothing at all. Does it matter? #!perl print "Content-type: text/html\n\n"; print <<'END_HTML'; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1...