cgi

CGI -- Temporary files

Hello! I'm developing a little CGI application (in C, with CGIC, http://www.boutell.com/cgic/). My application needs to create a temporary file (the user upload an images, it is saved, modified in various ways, and then shown back to the user). What precautions should I take while creating temporary files? The modified image is provide...

Why is $auth->loggedIn never true in my use of CGI::Session::Auth::DBI?

Using the examples from the CGI::Session::Auth::DBI and CGI::Session::Auth pages, I have attempted to implement the _login function with no success. I'm using Windows 7 and Apache 2. #!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser); use CGI; use CGI::Session; use CGI::Session::Auth::DBI; my $cgi = new CGI; # using '....

How to catch value of parameter in Apache2 CGI

Hello folks, I have a little apache2 CGI application on the Ubuntu. The CGI handler is bash shell script. My client application is search.html: <html> <body> <form action="/cgi-bin/search.sh" method="post"> <input type="text" name="searchKey" size="10"></input> <input type=SUBMIT value="search"> <form> </body> </html> firstly...

python CGI and JQUERY problem

I have a simple python CGI script where I query a MySQL database and then prints the result to the screen/webpage. My problem is that the "cursor.execute()" function returns a list of tuples. I use a simple for loop to iterate through this list and extract each tuple. This was working great until.....I got the bright idea to use jquery t...

Sending stdout as response from CGI spawned program

I'm trying to compose a .zip file in a CGI program and send that as the content response. I'm getting stuck in that whenever I spawn a program that prints to stdout, that somehow doesn't get accepted by Apache. It seems to be something to do with spawning a program that writes to stdout. The snippet below reproduces this problem. I ...

URL is changed after processing in C/CGI

Hello All, I have a C/CGI application. In order to redirect to the same page const char * redirect_page_format = "<html>\n" "<head>\n" "<meta http-equiv=\"REFRESH\"\n" "content=\"0;url=%s\">\n" "</head>\n" "</html>\n"; printf (redirect_page_format, getenv (URL)); Before this the url is like this "http://ipaddress/page.html". For so...

How can I load a Java applet from a dynamic server-side URL?

I want to load an applet from a server side script, eg. a Perl CGI program, etc. Can this be done? how? <applet code=A21 width=256 height=256 archive="http://url/cgi-bin/test.cgi?R=applet"&gt; thanks in advance for all help. ...

awk script as a webservice

Hi, I made a awk script to do stuff on some input files but as I want to avoid installing gawk on the windows machines I want this awk script to be available as a webservice or just a form where I can either upload a file or just copy the text of the file in a box and run the script on it and get back the result of the awk script. How ...

Perl script not working.. (Error : Premature end of script headers)

I am trying to print a XML file in the browser using a perl script. While I am trying to run the script in my browser I am having the following error. Server error! The server encountered an internal error and was unable to complete your request. Error message: Premature end of script headers: get_data.pl If you think this is a server...

How to begin writing an Application Server over Apache?

For my college project, I want to create a simple application server in C that runs over Apache. Like .php, .asp, .jsp, the extension of my files would be .sas. I have already written a parser which reads the .sas files and generates the output. For example, consider a file index.sas with the below code: <% echo "Hello"; %> ...

What are the pros and cons of using the two different programming styles of CGI.pm with Perl?

I am in a Web Scripting class at school and am working on my first assignment. I tend to overdo things and delve deeper into my subject than what is required in my classes. Right now I am researching CGI.pm to do my HTTP requests and it says there are two programming styles for CGI.pm: An object-oriented style A function-oriented style...

I never really understood: what is CGI?

CGI is a Comman Gateway Interface. As the name says, it is a "common" gateway interface for everything. It is so trivial and naive from the name. I feel that I understood this and I felt this every time I encountered this word. But frankly, I didn't. I'm still confused. I am a PHP programmer. I did lot of web development. user (clien...

Getting Apache to close connection after a certain size limit

I have a CGI script I'm writing that's handling a streaming file upload. I'm also using Apache. If a certain size limit is reached, I have the CGI script finish things up, then it sends an HTTP redirect and exit. What I'd like to have happen at this point is for Apache to close the connection. Instead, what Apache does is keep the co...

Should use CGI.pm's header method to output the Content-Type header?

If I'm using the CGI module in Perl, I can do this $cgi = CGI->new(); $cgi->header(-type=>"text/html"); Or go for the classic print "Content-Type: text/html\r\n\r\n"; Does it matter which we use? Is there any difference between the two? Both seem to work. For me I'd go for the first if I was using CGI anyway, but if not then I wou...

How can I get Dreamweaver to search Perl files?

I use Dreamweaver as my editor of choice for web development, and often find old projects have a few Perl files. For some reson the Dreamweaver find and replace dialog does not seem to recognise these Perl files e.g. .pl or .cgi as searchable files, so when I use the "find in folder" on a folder I know contains only Perl files it retur...

Is possible to intercept a request for a nonexistent file with lighttpd?

Is it possible to configure lighttpd so that a request for a file succeeds if the file exists, but is handled and redirected, for example to a cgi script, if the file does not exist? What I'm trying to achieve is having a set of image files on disk which are generated by a script and served directly. On a request, if the file does not e...

What are some unusual languages you have used for a CGI application?

I'm sure we (I'm referring to web developers) have at one time or another used a web scripting language like php, perl, python, or asp. But, we know you can also write cgi applications in languages like C. So, has anyone used an unusual language for writting CGI applications? By unusual, I mean a language that is not generally known fo...

Shared Hosting mail limits workaround

Hey guys, so i have a couple of sites on paid shared hosting, my host limits the mail to 300 per hour. One of my sites has more than 500 subscribers. My question is how can i send the newsletter to all my subscribers? is there a way or a script that i can use to send the first 300 users the email and after an hour to send the rest...? ...

howto run a cgi that is compiled as a linux binary on a linux web-host

All, My host supports Perl CGI scripts, how do I use a compiled CGI script on the host? I tried setting execute permissions via chmod, but when I try and run it via the browser, I get a server error. Thanks in advance for all help. ...

Have a Python CGI call a Perl CGI, passing original info (to limit searching private Mailman archives to logged-in users)

I need to have a Python CGI script do some stuff (a little bit of security checking), and then end up calling a Perl CGI script, passing anything it received (e.g., POST info) onto the Perl script. For background, my reason for doing this is that I'm trying to integrate Swish searching with Mailman list archives. Swish searching uses s...