cgi

login and logout of sessions in 2 cgi scripts

我只是一个虾纸丫 提交于 2019-12-10 17:45:16
问题 I need to store a login session when the user is login and remove the login session when the user has logged out of the system or the session has timeout. I am coding in Perl. I know I can use CGI::Session module in Perl but how do I make sure that the session is created by 1 cgi script and removed by another cgi script. Then all other pages of the system has to check if the session exist before it can display its contents. Currently, I am using the following code to create a new session when

disk I/O error with SQLite

十年热恋 提交于 2019-12-10 17:23:39
问题 I have a (tiny) dynamic website that is (roughly) a Perl CGI script using a SQLite database. Package DBI is the abstraction layer used in Perl. About one week ago, I started to see this error message: disk I/O error(10) at dbdimp.c line 271 Since this is a hosted site running Apache, I cannot see if the hard disk is (nearly) full. Access to command "df" is disabled.... but I used the (UNIX) shell command "yes > blah" to test the disk can still create new files. My database is very tiny --

How to execute Python CGI Script?

…衆ロ難τιáo~ 提交于 2019-12-10 17:22:01
问题 I want to execute a Python CGI Script within a .shtml file, but I just can't figure out how. I already found several ways?, but nothing seemed to work. And there it was a lot harder to find something that actually shows how to execute a script, and not how to write one ! ;/ My Html: http://pastebin.com/4sNZTZNQ And my Script: http://pastebin.com/w5vGXCBp I'm very new to CGI and any Webstuff, but I'm programming with Python over half an year now. PS: Sorry for the confusing formatting of the

G-WAN, output headers from CGI script

孤街浪徒 提交于 2019-12-10 17:17:48
问题 I'm trying to set an HTTP header like Content-Type over a CGI script. In PHP : header('Content-Type: text/plain'); // or echo 'Content-Type: text/plain', "\r\n\r\n"; // as first line or in Go : fmt.Print("Content-Type: text/plain\r\n\r\n") // as first line Both have no effect on the output. How can this be done? EDIT I also tried the following in Go , using the CGI package: package main import "fmt" import "os" import "net/http/cgi" func main() { r,e := cgi.Request() if e != nil { fmt.Println

How do I get code coverage of Perl CGI script when executed by Selenium?

孤街浪徒 提交于 2019-12-10 17:16:23
问题 I'm using Eclipse EPIC IDE to write some Perl CGI scripts which call some Perl modules that I have also written. The EPIC IDE lets me configure a Perl CGI "run configuration" which runs my CGI script. And then I've got Selenium set up and one of my unit test files runs some Selenium commands to run my cgi script through its paces. But the coverage report from Module::Build dispatch 'testcover' doesn't show that any of my module code has been executed. It's been executed by my cgi script, but

python: interact with the session in cgi scripts

杀马特。学长 韩版系。学妹 提交于 2019-12-10 15:56:56
问题 Can python cgi scripts write and read data to the session? If so how? Is there a high-level API or must I roll my own classes? 回答1: There's no " session " on cgi . You must roll your own session handling code if you're using raw cgi . Basically, sessions work by creating a unique cookie number and sending it on a response header to the client, and then checking for this cookie on every connection. Store the session data somewhere on the server (memory, database, disk) and use the cookie

Execute a .cgi file in Ubuntu

你。 提交于 2019-12-10 14:37:29
问题 I am running Apache/PHP under Ubuntu When I run the .cgi file, by going at http://localhost/mycgi.cgi , the browser will display the code instead of running it. How do I make the browser execute the CGI file instead of showing its contents? 回答1: Add these lines to your apache2.conf file <Directory /usr/local/apache2/htdocs/somedir> Options +ExecCGI </Directory> AddHandler cgi-script .cgi .pl 回答2: Obviously, CGI execution is not set up properly. Did you try the tutorial? Usually, all CGI

How to override PHP configuration when running in CGI mode

本秂侑毒 提交于 2019-12-10 14:08:25
问题 There are some tutorials out there telling me how to override PHP configuration when it is running in CGI mode. But I'm still confused because lots of them assume that the server is running on Linux. While I need to do that also on Windows. My hosting is indeed using Linux but my local development computer is using Windows XP with Xampp 1.7.3. So I need to do that in my local computer first, then I want to change the configuration on hosting server. The PHP in my hosting server is already run

Why do I need to explicitly output the HTTP header for IIS but not Apache?

寵の児 提交于 2019-12-10 13:34:11
问题 I am trying to set up apache instead of IIS because IIS needlessly crashes all the time, and it would be nice to be able to have my own checkout of the source instead of all of us editing a common checkout. In IIS we must do something like this at the beginning of each file: use CGI; my $input = new CGI(); print "HTTP/1.0 200 OK"; print $input->header(); whereas with apache we must leave off the 200 OK line. The following works with both: use CGI; my $input = new CGI(); print $input->header(

How can close and reopen STDOUT in Perl?

老子叫甜甜 提交于 2019-12-10 12:53:08
问题 I'd like to close STDOUT to prevent my code from outputing a particular image that I need for further computation but do not want on my web page. So i want to close STDOUT, do what I have to do with my code, then reopen STDOUT to output stuff to a web page. (Not to a file) What I tried is: close STDOUT; # my code here open STDOUT; This doesn't work... Thanks 回答1: There are several ways to approach your problem, and many of them do not require you to close STDOUT and risk fubaring your program