cgi

how do i write multiple conditions in single sql query to get data - Python mysql

好久不见. 提交于 2019-12-10 12:35:04
问题 I am in a dilema that how could i writ such sql queries to make a seach. I have tried and posted it, but it not as expected when user enter data in multiple field of a form and make a search. The query which i wrote form for a single form field and makes a search and display #!/usr/bin/python import cgi import MySQLdb class Table(): def __init__(self, host, user, passwd, name): self.db = MySQLdb.connect(host = host, user = user, passwd = passwd, db = name) self.cursor = self.db.cursor() def

Running Selenium webdriver from a Python CGI script

送分小仙女□ 提交于 2019-12-10 12:27:20
问题 I created a python script that uses Selenium webdriver to scrap a website. Now I'm trying to run this script from the web using CGI. So to ensure that my CGI server is working I tried this : import cgi print 'Content-Type: text/html' print list_brand = ['VOLVO','FIAT', 'BMW'] print '<h1>TESTING CGI</h1>' print '<form>' print '<select>' for i in range(3): print '<option value="' + list_brand[i] + '">'+ list_brand[i] +'</option>' print '</select>' print '</form>' And it worked fine. Now, When I

ajax request to python script

此生再无相见时 提交于 2019-12-10 11:42:10
问题 i just tested out a script i made. it is in python. i use ajax, to send a request and try and get the result. function ajaxFunction(){ var ajaxRequest; var e = document.getElementById("ktype"); var ktype = e.options[e.selectedIndex].value; var acookie = document.getElementById("acookie").value; alert (ktype +"\n" + acookie); try{ ajaxRequest = new XMLHttpRequest(); } catch (e){ try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject(

Does CPAN installing of new modules impact Perl-CGI applications on same live production server?

江枫思渺然 提交于 2019-12-10 11:17:37
问题 I have some Perl/CGI programs on a CentOS Linux webserver. I wish to write further applications that require Perl modules not currently installed. Does running CPAN on the same live production server impact these programs (which currently don't use the modules, obviously) in any way? 回答1: There's one possible way that it could have an effect. If the modules you are installing require newer versions of modules that you are already using, then it's possible that these newer versions could

FastCGI on Windows and Lighttpd

风格不统一 提交于 2019-12-10 11:09:10
问题 I'm looking to make my CGI forum software FastCGI compatible. The forum software consists of a few dlls and .exe (.cgi) files written in C and x86 assembly language. I also have a SQlite3 database. Lighttpd runs all these cgi scripts as child processes and I much say that the whole thing works pretty damn well. But I want to experiment with FastCGI. However, the examples are poor, the documentation is poor, and it really looks like it's made for Linux in mind. Did someone get FastCGI working

Difference between os.close(0) & sys.stdin.close()

我怕爱的太早我们不能终老 提交于 2019-12-10 10:33:09
问题 I'm working on some Python code which is a CGI script called from Apache. The first thing the code does is (I believe) attempt to close stdin/stdout/stderr with the following: for fd in [0, 1, 2]: try: os.close(fd) except Exception: pass Normally this works, however if they're not open, I get a "python.exe has stopped working", "A problem caused the program to stop working correctly" error message (Win32 exception). Couple of questions: What's the difference between closing via os.close

Show progress of PYTHON CGI script

不问归期 提交于 2019-12-10 10:28:32
问题 I have a PYTHON CGI script(Content-type: text/plain ) which takes about 10 minutes to execute. I want to see the execution status of my script on my browser . Like below: Part 1 of script executed... Part 2 of script executed.. Part 3 of script executed.. Execution Complete I am using print statements, but it is outputting all the print statements all-together only after the script has completed execution, and not one by one. Please help .. 回答1: Try doing: import sys ... print "Part 1 of

python json unicode - how do I eval using javascript

≯℡__Kan透↙ 提交于 2019-12-10 09:37:41
问题 Really spent a lot of time searching for this. Please need some help. I am trying to add multilingual feature to my web app framework. For this I am unable to send non ascii characters as JSON. Here is what I am doing Here is what I get from the database '\xe0\xa4\xa4\xe0\xa5\x87\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\xa4' which when I print gives me which is okay तेस्त I make the response object response = {'a':'\xe0\xa4\xa4\xe0\xa5\x87\xe0\xa4\xb8\xe0\xa5\x8d\xe0\xa4\xa4'} Send the repsonse import

In Perl, how do I send CGI parameters on the command line?

六月ゝ 毕业季﹏ 提交于 2019-12-10 04:33:15
问题 Normally i get the data from a webpage but i want to send it from the command line to facilitate debugging. To get the data i do something like: my $query = new CGI; my $username = $query->param("the_username"); this doesn't seem to work: $ ./script.pl the_username=user1 EDIT: Actually the above works. The if statement that checked $username was wrong (using == instead of eq ). 回答1: As I found out long time ago, you can indeed pass query string parameters to a script using CGI.pm. I am not

Apache+php5

泄露秘密 提交于 2019-12-10 03:51:15
1.下载回来的是解压文件,解压好放到要安装的位置。(我这里以D:\Acpache24为例) 2.打开Apache24\conf下httpd.conf 文件,用记事本打开即可。 (1)第37行ServerRoot "c:/Apache24"改为ServerRoot “D:/Apache24”;//Apache程序的位置。 (2)第204行的ServerAdmin改不改无所谓; (3)第213行ServerName前面的“#”号去掉; (4)第237行DocumentRoot "c:/Apache24/htdocs"改为DocumentRoot "D:/www";//网站的根目录 第238行<Directory "c:/Apache24/htdocs">改为<Directory " D:/www ">; 注意:这个WWW文件夹要自己去新建的,不建的话会报错的。 (5)第271行DirectoryIndex index.html改为DirectoryIndex index.html index.php index.htm //支持更多的默认页 (6)第354行 ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"改为ScriptAlias /cgi-bin/ "d:/Apache24/cgi-bin/" (7)第370行<Directory "c: