Questions tagged [cgi]

1) The Common Gateway Interface is a standard defining how web server software can delegate web page generation to a stand-alone application or executable file. 2) Computer Generated Imagery

This tag is mostly used for the Common Gateway Interface (CGI), which is a standard (see RFC 3875: CGI Version 1.1) that defines how web server software can delegate the generation of web pages to a stand-alone application, an executable file. Such applications are known as CGI scripts; they can be written in any programming language, although scripting languages are often used.

Less commonly on Stack Overflow, CGI may also be used to tag questions regarding Computer Generated Imagery.

See also

5191 questions
23
votes
6 answers

Why avoid CGI for Python with LAMP hosting?

I have been using PHP for years. Lately I've come across numerous forum posts stating that PHP is outdated, that modern programming languages are easier, more secure, etc. etc. So, I decided to start learning Python. Since I'm used to using PHP, I…
Andy Swift
  • 2,179
  • 3
  • 32
  • 53
23
votes
2 answers

Python 3.0 urllib.parse error "Type str doesn't support the buffer API"

File "/usr/local/lib/python3.0/cgi.py", line 477, in __init__ self.read_urlencoded() File "/usr/local/lib/python3.0/cgi.py", line 577, in read_urlencoded self.strict_parsing): File "/usr/local/lib/python3.0/urllib/parse.py", line 377,…
Evan Fosmark
  • 98,895
  • 36
  • 105
  • 117
23
votes
2 answers

Python os module open file above current directory with relative path

The documentation for the OS module does not seem to have information about how to open a file that is not in a subdirectory or the current directory that the script is running in without a full path. My directory structure looks like…
Matt Phillips
  • 11,249
  • 10
  • 46
  • 71
23
votes
3 answers

How do I access the HTTP Header of request in a CGI script?

I've used Perl a bit for small applications and test code, but I'm new to networking and CGI. I get how to make the header of a request (using CGI.pm and printing the results of the header() function), but haven't been able to find any info on how…
CGInewb
  • 231
  • 1
  • 2
  • 3
23
votes
8 answers

How can I send POST and GET data to a Perl CGI script via the command line?

I am trying to send a get or a post through a command-line argument. That is test the script in the command line before I test through a browser (the server has issues). I tried searching online, and I suppose I was probably using incorrect…
Parris
  • 17,833
  • 17
  • 90
  • 133
23
votes
6 answers

How to host python cgi script with `python -m SimpleHTTPServer 8000` or `python -m CGIHTTPServer 8000`?

When I run python -m SimpleHTTPServer 8000 or python -m CGIHTTPServer 8000 in my shell I am hosting the content of my current directory to the internet. I would like to make the following cgi_script.py work correctly using the above command in the…
Bentley4
  • 10,678
  • 25
  • 83
  • 134
22
votes
3 answers

Output images to html using python

I have a webpage generated from python that works as it should, using: print 'Content-type: text/html\n\n' print "" # blank line, end of headers print '
Kilizo
  • 3,192
  • 4
  • 19
  • 20
22
votes
4 answers

Reading a client's header from Python CGI script?

I'm writing a very simple web service, written in Python and run as CGI on an Apache server. According to Python docs (somewhere... I forgot where), I can use sys.stdin to read the data POSTed by a random client, and this has been working fine.…
jbreed
  • 1,514
  • 5
  • 22
  • 35
22
votes
2 answers

Posting html form values to python script

I have created html form with text box and button enter ur search keyword My requirement is to pass the text box value in to my test.py code, is there any way to do it. Please suggest me how do it.
Vittal Cherala
  • 447
  • 1
  • 6
  • 14
22
votes
7 answers

sys_get_temp_dir in shared hosting environment

Note: This could also fit in superuser. I am setting up PHP 5.3.10 on a shared host with apache2 mpm itk and open_basedir in a way, that each user may not see or change the files of another user. In the apache2 vhost settings, I add the appropriate…
Lars
  • 5,757
  • 4
  • 25
  • 55
22
votes
10 answers

IIS 7.5 PHP failure "The FastCGI process exited unexpectedly"

I've been attempting to get PHP working with IIS 7.5 and have hit a bit of a roadblock. Whenever I try to load the page I get the following error: "HTTP Error 500.0 - Internal Server Error C:\Program Files\PHP\php.exe - The FastCGI process exited…
Vilid
  • 331
  • 1
  • 2
  • 4
21
votes
4 answers

Perl CGI hacked? But I'm doing everything right

I just noticed some strange PHP files in one of my web directories. They turned out to be spammer-placed exploit files. They've been there since 2006, around the time that I was running a high-profile donation campaign using a CGI script of mine.…
Jason Rohrer
  • 503
  • 4
  • 14
20
votes
2 answers

How to get file from POST data in Bash CGI script?

I am trying to post a file using cURL and receive it on the other side via a CGI Bash script and store it with the same name. After upload is completed, diff between the original file and reconstructed one should return zero. The way cURL sends…
sorush-r
  • 10,490
  • 17
  • 89
  • 173
20
votes
6 answers

Which C++ Library for CGI Programming?

I'm looking at doing some work (for fun) in a compiled language to run some simple tests and benchmarks against php. Basically I'd like to see what other people use for C++ CGI programming. (Including backend database, like mysql++ or something…
Issac Kelly
  • 6,309
  • 6
  • 43
  • 50
20
votes
2 answers

Python CGI returning an http status code, such as 403?

How can my python cgi return a specific http status code, such as 403 or 418? I tried the obvious (print "Status:403 Forbidden") but it doesn't work.
cfischer
  • 24,452
  • 37
  • 131
  • 214