cgi

Why does my Perl CGI complain about "Premature end of script headers"?

I'm sure someone could answer this very quickly, but I'm just new to perl... I'm trying to modify demarc (a simple network monitoring tool) to do a system call to a simple script. The script itself does nothing, I'm just trying to do a 'proof-of-concept' because I keep getting an internal server error. Permissions to the script have bee...

C, HTML and CGI

Hi , I have a functionality written in C. I have to give input through the html page and the operation to be processed in C (on submit of a button) and the result has to be given to the same html page. Please help me out by given some simple examples. ...

How to get result back from CGI(C) to the same HTML page?

Hi, Can I display the result which is processed in the CGI(using C) on the same html page, from where the CGI is invoked? Regards, MalarN ...

Is it possible to send POST parameters to a CGI script without another HTTP request?

I'm attempting to run a CGI script in the current environment from another Perl module. All works well using standard systems calls for GET requests. POST is fine too, until the parameter list gets too long, then they get cut off. Has anyone ran in to this problem, or have any suggestions for other ways to attempt this? The following...

Are there any problems handling a POST request as a GET request on the server

In an attempt to resolve the issue I posted in this question: Is it possible to send POST parameters to a CGI script using a system() call? So far the only successful resolution to the problem is to trick the environment to think the request was a GET. I do this by converting the POST parameters to a query string, saving that string i...

Server Internal Error : Premature end of script headers in file.cgi

Hi, I am running Apache server. When I send the request from HTML using ajax call to cgi, I am not getting any response. I found the following error statement in the httpd/error_log file: Premature end of script headers: file.cgi When I gave alert to the status code, it returned 500 Internal Server Error. How to resolve this? ...

How to get back to the same html page using cgi?

Hi, I am having C function. From the html page, through ajaxcall the request is passed and the response is got. If I perform some action like click submit button, then some action will be performed. How to get back to the same html page after redirection? Can I set the environment variable which automatically redirects me to that pag...

How can I add an image to a table in Perl?

I have developed a database using Perl DBI and display using Perl CGI. Can you please suggest syntax for adding an image to the table and its background in the database. ...

Display the result on the webpage as soon as the data is available at server

I am writing a cgi page in Python. Let's say a client sends request to my cgi page. My cgi page does the calculation and as soon as it has the first output, it sends back that output to the client, but it will CONTINUE to do the calculation and send other responses AFTER the first response is sent. Is what I have presented here possibl...

How to get the REMOTE_PORT (the client port) in Python running at IIS 7.5? REMOTE_PORT server variable cannot be found!

Hey. I'm coding a cgi in Python, running on an IIS 7.5 web server, on Windows. I would like to get the tcp port (usually was the server environment variable REMOTE_PORT) from which the client is connecting to it. I've tried to look up all the way throuhout the keys as in os.environ.keys() and I can get the user IP address, his browser,...

How to create and maintain session ?

Hi, I am using HTML, C, CGI. Now I need to create and maintain sessions.How can I do that? If any tutorial talks about this, please let me know. ...

How to implement simple online management for a book library?

At my institution, we have a small library with 150 books and 50 users. We would like to use a simple online management system that displays the books, lets users search and enter when they get and return a book. (There is no librarian, the books are just in an otherwise empty room.) I'm not familiar with modern web content management s...

Liteweight CGI Server to use on local machine to serve KML to Google Earth via Python or similar?

Greetings, I want to write a script that handles simple http requests from Google Earth and sends back KML to display map tiles that are stored locally. I would LIKE to use Python but any language is fine. I have not ever done anything with CGI, but I think this is the simplest way to accomplish my task. This is what the Google KML d...

How can I read the URL-Data send with POST in Perl?

I'm trying to read out the POST-Data that was sent from a form in a page to my Perl Script. I googled and found out that: read(STDIN, $param_string, $ENV{'CONTENT_LENGTH'}) reads out the whole Data-String with and writes the whole string to $param_string in the form of Param1=Value1&Param2=Value2&Param3=Value3 by spliting it at the...

Limit calls to external database with Python CGI

I've got a Python CGI script that pulls data from a GPS service; I'd like this information to be updated on the webpage about once every 10s (the max allowed by the GPS service's TOS). But there could be, say, 100 users viewing the webpage at once, all calling the script. I think the users' scripts need to grab data from a buffer page ...

How can I determine if a script was called from the command line or as a cgi script?

I have a script that I wrote that can either be used on the command line or as a CGI script, and need to determine how the script was called so I can output a content-type header for web requests (and maybe some anti-cache headers too). My first thought is to check for the existance of http environment variables: my $js = build_javascri...

How to view error messages from ruby CGI app on remote server?

I have written a Ruby (not Rails) app which generates web pages. The script is installed on a linux web server and is called up by apache using CGI in response to HTTP requests. Pretty standard stuff. When I am running it on my own computer I look at the apache error log to see the ruby error messages. However, on the host that I use ...

how to process image efficiently after upload

Hi, this is for user avatar and users photo albums. I have gotten upload working but i need some guidelines on: when to do the following steps: image resize and update database with image info. The upload is handled by a simple cgi script on the front-end server instead of the main app server behind it in order to avoid to tie up the m...

CGI and .net webservic

Hi We have to recieve an incoming call from client's wbeserver It is looking for url webservice/somethig.cgi in our webserver How can I map this to our .net webservice? ...

Why form posting yields $_FILES['thefile']['name'][0] instead of $_FILES['thefile'][0]['name'] ?

When you name several file input fields with the same name and an array index like so: <input type='file' name='thefile[0]'> <input type='file' name='thefile[1]'> Then in the form submission you get this: $_FILES['thefile']['name'][0] $_FILES['thefile']['name'][1] And so on with the other fields. I find this annoying because it preve...