cgi

Curl to internal folder not working wth CGI interface

I am using a server with CGI interface and trying to get a script on there to use curl to get data from an api in another directory like so: website/admin/pages/ -has a curl script that calls website/api/pages/ This fails. I don't even get a response shown in the curlinfo that should give a header. It just has a 0 for header and not a...

how to use stdin on perl cgi

I am new to perl and I want to use screen input on my script. here is my script and I want the IOS command to be enter from keyboard. can some one show me where I am wrong.the problem i have now the script not read my keyboard input, I am not sure if work on my case. thanks!! # ### Show ################################################...

Scaling a simple Perl CGI to a high volume server

I wrote a Perl program which searches and manipulates one text file. This CGI process slurps the file directly into memory, manipulates the file based on the User's input, then generates the HTML result. It works functional wise. However, I know that once I deploy on high volume server, it will not be able to respond in due time. I sus...

Trouble with receiving data from <form>

HTML: <form enctype="multipart/form-data" action="/convert_upl" method="post"> Name: <input type="text" name="file_name"> File: <input type="file" name="subs_file"> <input type="submit" value="Send"> </form> Python (Google App Engine): if self.request.get('file_name'): file_n...

What to do if I have a CGI that runs for several minutes before outputting data, and Apache times it out?

I have a CGI script that takes a really long time to execute. Long story short, it needs to process a lot of data, run a bunch of slow commands, and make some slow web queries, during which time it doesn't output anything, and when it's done, it finally prints its results out in JSON format. It takes several minutes to run, which is long...

Easiest way to log visitor's ip

Hi, What is the easiest way to set up a page to log a visitors ip address. I just want to record when the visitor came and from what ip. Should I be looking at google analytics for this or is there some simple script I can throw on the page to do it. Any pointers much appreciated, ...

Project ideas to become good at C++

I want to get into C++ team at work. Their job is to write CGIs in C++ (mainly but not limited to). I know basic C++. Reading the list at C++ book guide question on SO, I've got three books from a friend (I actually had the first one). The C++ Programming Language - Bjarne Stroustrup - for reference C++ Templates The Complete Guide - ...

Getting HTTP GET arguments in Python

I'm trying to run an Icecast stream using a simple Python script to pick a random song from the list of songs on the server. I'm looking to add a voting/request interface, and my host allows use of python to serve webpages through CGI. However, I'm getting hung up on just how to get the GET arguments supplied by the user. I've tried the ...

cgi-bin question

I have access to a shared web host. The website installed there uses exec(). About 4 months ago the function was enabled, but now they have put it on the disable_functions list. They put exec, passthru and shell_exec on that list but they forgot to put system:) This makes me think that the server admin is not very aware on what he's doi...

C/C++ CGI on Embedded device, POST, GET, LOGIN?

Hi all, I have here a small embedded device with uClinux. There is a Boa web-server, that supports CGI scripts. I need to make basic dynamic pages. Requirements GET method for navigation POST method for forms LOGIN for authentication I found this page http://www.cs.tut.fi/~jkorpela/forms/cgic.html There is described how to implemen...

Should I use the function-oriented or object-oriented CGI interfaces?

I've been learning about the CGI module lately, and the book I'm using shows there are two ways you can use CGI, function-oriented or object-oriented. They say the benefit of having object-oriented is only to be able to create two CGI objects. First of all is this true, and are there any other benefits, and secondly what example is there...

How to execute a shell script in cgi-bin?

OK first of all, I am a PHP programmer but I have never done anything with CGI and don't know what it is. I know it stands for Common Gateway Interface, but I do not know what it does or what its for. I was just told that I can upload a shell script to my cgi-bin folder and execute it. I made a shell script myscript.sh and uploaded it ...

simplest way to embed Perl in html

Hi all: I've researched online and found several interesting Perl modules/frameworks, such as HTML:Mason, HTML::Embperl, or the MVC Catalyst framework, etc,which can let me embed Perl inside html, similarly like PHP code inside html. However, my Perl project must be uploaded to uni server where only limited privilege and resources are ...

Redirecting from one CGI page to another

I am a nembie to CGI with Perl, please do help me out and please do correct me wherever I have committed a mistake. This is the code. The problem is that after the password is validated and found as correct, instead of redirecting to the next page it is giving this message: Status: 302 Found Location: http://localhost/cgi-bin/Main.cgi ...

How can I redirect the client from one CGI page to another using Perl?

My problem is the following. After the password is recognized as valid I need to redirect to main.cgi but I am getting the message as: Status: 302 Found Location: http://localhost/cgi-bin/Main.cgi I know the reason for this is that I am writing this statement after Content-Type so it is taking this as HTML and printing it on screen. I...

What is an efficient way to make a PHP front end to a Django project (that runs through cgi)?

I want to develop a site in Django, to have the convenient ORM, and admin, to ease administration. However, the only hosting option I have is running Django through CGI. Therefore, I would also like to make a "read-only" front end in PHP, which will make the experience "normal" for everyday use (i.e only editing [the database] and authe...

How to compile c++ using mingw from an apache cgi?

Hi ! I'm trying to execute mingw's g++ from inside a cgi written for apache. The line I execute is: c:\mingw\bin\g++.exe -Wall -IC:\hpxbase -O2 -c -v -o code.o code.cpp This works when I call exactly this line from a cmd window. But when run from my cgi, g++ crashes. I made the cgi open up ots own console window and there is the messa...

QuickBooks SDK, using Perl, works in command console, not as CGI?

I'm using the QBXML method to communicate with QuickBooks on a local machine (not remotely, not using web connector). I have a very basic script which just connects to QuickBooks and checks to see if a Customer exists or not. The script works perfectly when run through the command console (Windows XP) but the same exact script, no chan...

How can I encrypt and decrypt passwords in a Perl CGI program?

Am new to Perl CGI, using ActivePerl, SQLite DB, Apache server and Windows. I have an entry form in which their are fields like Id, Name, Password and so on. Whenever anybody makes a new entry then whatever they enter into password field that should be encrypted and get stored in database. The next time when that same user enters the ...

Creating a Combobox in HTML

Actually I have a CGI form which consists of textfields and I need a combobox in which I can enter my own data dynamically. May be it seems very silly question but I am new to cgi-perl as well as HTML so no idea what to do. Here is my form: #!C:\perl\bin\perl.exe use CGI; use CGI qw/:standard/; use CGI::Carp qw(warningsToBrowser fatal...