cgi

How do I read a text file by putting its data in a table using CGI in Perl?

一世执手 提交于 2019-12-12 05:17:03
问题 The CGI to read the data from merch.txt works but how can I put this in a table? HTML File: <form action="/cgi-bin/asst5/data.cgi" method="post"> <table border="2" cellspacing="5" cellpadding="5"> <tr> <td align="center">SKU: </td> <td><input type="text" name="code" size="15"></td> </tr> <tr> <td align="center">Name: </td> <td><input type="text" name="customer" size="15"></td> </tr> </table> </form> Data.CGI where data is accepted after it's been entered in the HTML my $sku = param('code');

Refresh web page using a CGI Python script

自闭症网瘾萝莉.ら 提交于 2019-12-12 05:07:07
问题 I have a very simple web page which I'm using in order to rotate a stepper motor on Raspberry Pi. My html file is this: <html> <head> <script Language="Javascript"> function ccw() { document.location="cgi-bin/rotate_45_ccw.py"; } function cw() { document.location="cgi-bin/rotate_45_cw.py"; } </script> </head> <body> <div style="text-align:center"> <h1>Raspberry Pi GPIO</h1> <br> <button type="button", id="ccw", onclick="ccw()", value="value CCW">Rotate CCW</button> <button type="button", id=

php cgi error in PhpStorm when php-cgi is installed

送分小仙女□ 提交于 2019-12-12 04:18:18
问题 I am having a problem with PhpStorm (10.0.3) on OS X El Capitan‎ throwing a php-cgi not found error on PHP 7 cgi/fastcgi. I tried the solutions offered in "How do I install php-cgi? I tried MacPort, Package and everything else but none works", but these did not work. I've consulted this: http://blog.jetbrains.com/phpstorm/2013/09/built-in-webserver-in-phpstorm/ but it is not helpful. I also tried a cgi install of PHP 5.6 but this has the same problem as PHP 7. I have installed PHP70-cgi using

POST-ing to php-fpm increases disk i/o writes

孤者浪人 提交于 2019-12-12 04:08:56
问题 I'm sending POST data about 100KB to my application and it causes php-pfm process to create many pipes and write to disk. I'm wondering how this can be avoided. PID USERNAME VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND 3915 www 6773 298 0 38 0 38 8.86% php-fpm 3932 www 4744 177 0 10 0 10 2.33% php-fpm 3753 www 4522 157 0 52 0 52 12.12% php-fpm 3910 www 3551 166 0 51 0 51 11.89% php-fpm 3934 www 4169 207 0 45 0 45 10.49% php-fpm 3989 www 3183 152 0 13 0 13 3.03% php-fpm 3844 www 4176 134

Truncated output using Python bottle 0.12.8 as a CGI application under Windows on an Apache server

让人想犯罪 __ 提交于 2019-12-12 03:38:41
问题 This is the application: #!/home2/friendv0/Python-2.7.9/bin/python from bottle import Bottle app = Bottle() @app.get('/') def hello(): return """<!DOCTYPE html> <html lang="en"> <head> <title>bottle Test</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> </head> <body> Hello! </body> </html> """ app.run(server='cgi') The resulting output is: <!DOCTYPE html> <html lang="en"> <head> <title>bottle Test</title> <meta name="viewport" content="width

How can I send error message if user doesn't select a radio button Perl/CGI

房东的猫 提交于 2019-12-12 03:37:14
问题 Attempting to code my very first Perl/CGI script and have run into some areas I don't quite understand how to move forward. Created a HTML page that has information a user inputs and is sent to the script. The script then outputs the information on a second page back to the user with errors should the user not follow the directions. My forms take on an appearance like the following: Item Number: User enters a number Product Name: Product Cost: Selling Price: Product Category: - radio button 1

Keep line formatting in browser with bash CGI

寵の児 提交于 2019-12-12 03:26:59
问题 I'm using this bash CGI: #!/usr/bin/sh echo "Content-type: text/html" echo "" echo `ls -al` And it produces ie: total 52 drwxrwxrwx. 2 root root 4096 Feb 2 18:34 . drwxr-xr-x. 8 root root 4096 Feb 2 17:58 .. -rw-r--r--. 1 root root 36310 Feb 2 17:45 dds.jpg -rw-rw-rw-. 1 user user 50 Feb 2 18:03 dds_panel.htm -rwxrwxrwx. 1 user user 460 Feb 2 18:34 test-cgi.cgi In a terminal they appear each neatly on a single line but in the browser they appear all on the same line. What's the best way to

CGI won't run just download on Apache server

旧城冷巷雨未停 提交于 2019-12-12 02:52:06
问题 I'm completly new to CGI and Apache but I'm trying out a few things. To start I wrote a simple hello CGI in C. #include <stdio.h> void main() { printf("Content-type: text/html\n\n"); printf("<html>\n"); printf("<head><title>CGI Output</title></head>\n"); printf("<body>\n"); printf("<h1>Hello, world.</h1>\n") ; printf("</body>\n"); printf("</html>\n"); } compiled it gcc hello.c -o hello.cgi and placed it in /var/www/mycgi Afterward I modified httpd.conf to add the following ScriptAlias /mycgi/

Deploying flask app to Apache shared hosting

时光毁灭记忆、已成空白 提交于 2019-12-12 02:25:50
问题 I am trying to deploy a simple flask application in the Apache shared hosting server. I am not sure what is wrong here. I am stuck at the .cgi file for now. The flask app - hello.py: #!/usr/bin/python from flask import Flask app = Flask(__name__) @app.route("/") def hello(): return "Hello World!\n" if __name__ == "__main__": app.run() The myapp.cgi file: #!/usr/bin/python import os from wsgiref.handlers import CGIHandler from hello import app os.environ['SERVER_NAME'] = '127.0.0.1' os.environ

Want to hide cgi rendered html text for hostname when username text column is empty

强颜欢笑 提交于 2019-12-12 02:14:06
问题 I have the current perl code in a .cgi file that we run on our server. This allows us to know which employees are using specific machines, by displaying: hostname - username However, I would like to be able to hide the host names that have no user present to shorten the rendered text, but I am unfamiliar with doing this. If possible, I would also like to add logic to display a message when there are no staff logged in, like 'No staff on shift'. Also, these aren't the real user/passwords, just