cgi

how to do client side sorting using querystring in hyperlink associated with the table header using Perl?

南楼画角 提交于 2019-12-04 07:15:46
问题 Hello everybody i hope everybody is doin well, Actually i have a table in which i fetch the data from sqlite database,i have done the paging and filtering for the grid using perl,now i need to do the sorting. The way in which i want to do is "MAKE THE TABLE HEADERS AS HYPERLINK AND WHENEVER I CLICK THEM THEN IT SHOULD SORT THE TABLE IN ASCENDING OR DESCENDING "ORDER BY" THE COLUMN WHICH I CLICK. Please do let me know is it possible, if yes then please do guide me find the solution. HERE'S My

php-cgi running very slowly on windows

泪湿孤枕 提交于 2019-12-04 06:26:06
问题 I'm trying to speed up my wordpress site because for some reason it's taking on average 5 seconds to load a page (obviously way too slow). I've tracked it down to the php-cgi.exe hogging an incredibly large amount of cpu time, but now have no idea how to figure out why or how to fix it. Any ideas how I could debug the php-cgi.exe and figure out what is slowing it down? 回答1: PHP itself should definitely not be doing that. Are you sure it is PHP, and not the script you are running? Try a simple

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

限于喜欢 提交于 2019-12-04 05:57:19
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 am a newbie to Perl. Can anybody please help me find the solution for this and make my code work the way I want it to? Or please suggest me some alternative code for this, or any link which might help me out. #!C:\perl\bin\perl.exe use strict; use CGI qw(

Can $_SERVER['REMOTE_USER'] be spoofed?

a 夏天 提交于 2019-12-04 05:12:36
I have a situation where I am opening a file based on the $_SERVER['REMOTE_USER'] variable. I don't think this is spoof-able but would just like to confirm. I do not want to make myself vulnerable to the reading of arbitrary files: <? $user = $_SERVER['REMOTE_USER']; $fp = fopen("./$user.png","r"); ?> Yes, that username is whatever is specified by the remote user. You need to verify password as well. If password is verified by your server, and not your application, then you are probably okay. 来源: https://stackoverflow.com/questions/12942065/can-serverremote-user-be-spoofed

Python CGI queue

只愿长相守 提交于 2019-12-04 05:04:40
问题 I'm working on a fairly simple CGI with Python. I'm about to put it into Django, etc. The overall setup is pretty standard server side ( i.e. computation is done on the server): User uploads data files and clicks "Run" button Server forks jobs in parallel behind the scenes, using lots of RAM and processor power. ~5-10 minutes later (average use case), the program terminates, having created a file of its output and some .png figure files. Server displays web page with figures and some summary

Why does my system call to another CGI script work on the command line but not when run as a CGI program?

对着背影说爱祢 提交于 2019-12-04 04:55:06
问题 I have a scriptA.cgi which calls scriptB.cgi. scriptB.cgi requires a param. I have tried both inside scriptA.cgi I have tried: `perl -l scriptB.cgi foo="toast is good" `; as well as @args = ("perl", "-l", "scriptB.cgi", "foo=\"toast is good\""); system(@args); When I call scriptA.cgi from the command line it works as expected. However when I call scriptA.cgi through the browser scriptB.cgi is executed but it fails to read the incoming param and prints foo as empty. Is there a less ugly way to

cgi.parse_multipart function throws TypeError in Python 3

别说谁变了你拦得住时间么 提交于 2019-12-04 04:35:27
I'm trying to make an exercise from Udacity's Full Stack Foundations course. I have the do_POST method inside my subclass from BaseHTTPRequestHandler , basically I want to get a post value named message submitted with a multipart form, this is the code for the method: def do_POST(self): try: if self.path.endswith("/Hello"): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers ctype, pdict = cgi.parse_header(self.headers['content-type']) if ctype == 'multipart/form-data': fields = cgi.parse_multipart(self.rfile, pdict) messagecontent = fields.get('message')

Python CGIHTTPServer crashes with “OSError: [Errno 13] Permission denied”

微笑、不失礼 提交于 2019-12-04 04:16:25
I am running the following command from my home directory: python -m CGIHTTPServer This runs the server, but when I try to access a script in the cgi-bin directory I get: Traceback (most recent call last): File "/usr/lib/python2.7/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, env) OSError: [Errno 13] Permission denied Running as root does not make a difference. The files seem to have all the right permissions: student@bandersnatch:~$ ls -lhR .: total 12K drwxr-xr-x 2 student student 4.0K Jun 13 18:38 cgi-bin drwxr--r-- 2 student student 4.0K Jun 10 2004 kalpy -rwxrwxrwx 1

Python CGIHTTPServer Default Directories

筅森魡賤 提交于 2019-12-04 03:57:18
问题 I've got the following minimal code for a CGI-handling HTTP server, derived from several examples on the inner-tubes: #!/usr/bin/env python import BaseHTTPServer import CGIHTTPServer import cgitb; cgitb.enable() # Error reporting server = BaseHTTPServer.HTTPServer handler = CGIHTTPServer.CGIHTTPRequestHandler server_address = ("", 8000) handler.cgi_directories = [""] httpd = server(server_address, handler) httpd.serve_forever() Yet, when I execute the script and try to run a test script in

Perl CGI with HTTP Status Codes

坚强是说给别人听的谎言 提交于 2019-12-04 03:51:25
问题 I have the following validation in a CGI script that will check for the GET method and return a 405 HTTP status code if the GET method is not used. Unfortunately it is still returning a 200 Status OK when using POST or PUT. my ($buffer); # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; } else { $cgi->$header->status('405 Method Not Allowed') print $cgi->header('text/plain'); } I am still new to CGI programming so I