cgi


Undefined subroutine &Db::connection called

百般思念 提交于 2020-01-16 11:57:29
问题 I want to insert data in database using perl &CGI but i have the following error : Undefined subroutine &Db::connection called at C:/wamp/bin/apache/apache2.2.22/cgi-bin/test.pl line 13. test.pl sub change{ my $Data = { table =>'student', action => 'insert', data => { Name => 'LL', Surname => 'GG', Age => '20' } }; return Db::update($Data); }; sub test { my $Data = { table =>'student', action => 'insert', data => { Name => 'LL', Surname => 'GG', Age => '20' }, }; return Db::insert($Data); };

How to download a file in Python (Jinja2) on-click Export button?

我怕爱的太早我们不能终老 提交于 2020-01-15 06:56:26
问题 I have a button export : <button class="aptButton" formaction="/export/" type="submit">export</button> and I have this in the /export/ index.cgi #! /apollo/sbin/envroot $ENVROOT/bin/python # -*- coding: utf-8 -*- import cgitb cgitb.enable() import cgi def main(): print "Content-Type: text/html" print form = cgi.FieldStorage() results = helpers.getResults() environment = helpers.get_environment() print environment.get_template('export.html').render( results = results) main() and I have this in

Cgi-bin scripts get run without a user?

Deadly 提交于 2020-01-15 03:12:09
问题 I'm running a binary that requires a license key to reside in the user's home directory. I'm making a cgi script that calls upon this binary and everything is happy when I execute the script from the command line using sudo -u www-data binary. However, when I run the cgi script from the web, the binary can't find the license key. The apache error log states: License key "(null)/.key" not found., referer: Does this mean that cgi scripts are executed without any user attached for security

Writing CGI script in Java

旧城冷巷雨未停 提交于 2020-01-14 14:04:57
问题 I trying to figure out how to write CGI scripts in Java. I followed this examples -> http://www.javaworld.com/jw-01-1997/jw-01-cgiscripts.html?page=1 It provide cgi_lib.java, hello.html and hello.java Everything seems fine, but in the html part. The action is pointed to cgi_lib/hello.cgi There's no cgi provided. So I tried with cgi_lib/hello.java, and it print the entire source code in the hello.java. Then i tried to edit the hello.java extensions into hello.cgi, and tried again. The browser

Writing CGI script in Java

最后都变了- 提交于 2020-01-14 14:03:40
问题 I trying to figure out how to write CGI scripts in Java. I followed this examples -> http://www.javaworld.com/jw-01-1997/jw-01-cgiscripts.html?page=1 It provide cgi_lib.java, hello.html and hello.java Everything seems fine, but in the html part. The action is pointed to cgi_lib/hello.cgi There's no cgi provided. So I tried with cgi_lib/hello.java, and it print the entire source code in the hello.java. Then i tried to edit the hello.java extensions into hello.cgi, and tried again. The browser

Python: CGI update webpage before script exit

拥有回忆 提交于 2020-01-14 02:29:05
问题 Okay here's my situation. I wrote a HTML form with a textarea that submits a POST request to my python script. I use cgi library to parse the textarea and split it into an array. I then process the items using a loop and print items as they're processed. It seems that even though I put the print statement in the loop it doesn't print until the entire process is completed and the script has exited. The html page also hangs until the process is finished. I have tried to flush the buffer using

Apache/httpd /var/www/html/ .cgi scripts throw 500 internal server error

我们两清 提交于 2020-01-13 06:12:26
问题 I installed a new CentOS 7 x86_64 LAMP server today. I compiled a simple CGI script in c and i called it test.cgi, and I enabled the AddHandler for .cgi scripts. However everytime i try to load the /test.cgi page from my /var/www/html directory any simple .cgi script will throw me a 500 internal server error page. I tested that the script is working fine from the /var/www/cgi-bin directory. My server is running selinux and apache/httpd is using suEXEC. EDIT: also I didn't create any extra

Apache/httpd /var/www/html/ .cgi scripts throw 500 internal server error

て烟熏妆下的殇ゞ 提交于 2020-01-13 06:12:21
问题 I installed a new CentOS 7 x86_64 LAMP server today. I compiled a simple CGI script in c and i called it test.cgi, and I enabled the AddHandler for .cgi scripts. However everytime i try to load the /test.cgi page from my /var/www/html directory any simple .cgi script will throw me a 500 internal server error page. I tested that the script is working fine from the /var/www/cgi-bin directory. My server is running selinux and apache/httpd is using suEXEC. EDIT: also I didn't create any extra

How to change Apache httpd.conf file on Mac OS X?

心已入冬 提交于 2020-01-13 04:31:09
问题 I'm on a MacBook running OS X trying to teach myself how to write CGI scripts and I'm stuck on the very first step, altering the httpd.conf file. I'm following these instructions: http://www.cgi101.com/book/connect/mac.html and I'm trying to alter the httpd.conf file using the terminal command sudo vim /etc/apache2/httpd.conf . However when I get ready to try and save the file it says that it's read-only. The instructions that I'm following say that I'm supposed to uncomment the line

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

故事扮演 提交于 2020-01-12 20:27:50
问题 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

工具导航Map