cgi

Passing input from html to python and back

拥有回忆 提交于 2021-01-18 04:37:02
问题 I need to make a webpage for an assignment, it doesn't have to be uploaded to the web, I am just using a local .html file. I did some reading up and came up with the following html and python: <!DOCTYPE html> <html> <head> <title> CV - Rogier </title> </head <body> <h3> Study </h3> <p> At my study we learn Python.<br> This is a sall example:<br> <form action="/cgi-bin/cvpython.py" method="get"> First Name: <input type="text" name="first_name"> <br /> Last Name: <input type="text" name="last

Passing input from html to python and back

烈酒焚心 提交于 2021-01-18 04:34:09
问题 I need to make a webpage for an assignment, it doesn't have to be uploaded to the web, I am just using a local .html file. I did some reading up and came up with the following html and python: <!DOCTYPE html> <html> <head> <title> CV - Rogier </title> </head <body> <h3> Study </h3> <p> At my study we learn Python.<br> This is a sall example:<br> <form action="/cgi-bin/cvpython.py" method="get"> First Name: <input type="text" name="first_name"> <br /> Last Name: <input type="text" name="last

Enabling CGI in Apache on MacOS

穿精又带淫゛_ 提交于 2021-01-07 07:40:34
问题 I'm attempting to enable CGI in Apache on MacOS and so far have attempted a lot of steps listed on the website. Whenever I hit the "Submit" button on my page, it just displays the contents of the cgi (or python) file instead of executing it. Here're some of the details: OS: MacOS Catalina Apache Server: 2.4.41 CGI File has a PY extension, so httpd.conf located at /private/etc/apache2 and /usr/local/etc/httpd has been modified. Also renamed the .py file to .cgi , not sure if it matters but I

Enabling CGI in Apache on MacOS

▼魔方 西西 提交于 2021-01-07 07:28:35
问题 I'm attempting to enable CGI in Apache on MacOS and so far have attempted a lot of steps listed on the website. Whenever I hit the "Submit" button on my page, it just displays the contents of the cgi (or python) file instead of executing it. Here're some of the details: OS: MacOS Catalina Apache Server: 2.4.41 CGI File has a PY extension, so httpd.conf located at /private/etc/apache2 and /usr/local/etc/httpd has been modified. Also renamed the .py file to .cgi , not sure if it matters but I

How to make 'Content-type: text/html' not to be displayed in output?

北慕城南 提交于 2020-12-15 06:03:45
问题 I have a cgi python script which gets data from html form, handles it and makes a table which put to html code. The snip of the code: # -*- coding: utf-8 -*- import cgi print('Content-type: text/html\n') print() print("""<!DOCTYPE HTML> <html> # and etc. When I use the form I see the new page with a table but before this table I see the text string Content-type: text/html\ How to change the python code for not displaying this string in browser. Put it in comment doesn't help. 来源: https:/

How to make 'Content-type: text/html' not to be displayed in output?

谁都会走 提交于 2020-12-15 06:02:51
问题 I have a cgi python script which gets data from html form, handles it and makes a table which put to html code. The snip of the code: # -*- coding: utf-8 -*- import cgi print('Content-type: text/html\n') print() print("""<!DOCTYPE HTML> <html> # and etc. When I use the form I see the new page with a table but before this table I see the text string Content-type: text/html\ How to change the python code for not displaying this string in browser. Put it in comment doesn't help. 来源: https:/