AFUL

CGI: Exemple

 contents contents next

Ex: (appelé par http://localhost/cgi-bin/test.py?nom=St%e9fane:

#!/usr/bin/python
import os, cgi
form = cgi.FieldStorage()
print "content-type: text/html"
print
print "<html><body>Salut %s, tu utilises \
  le navigateur %s.</body></html>" \
  % (form['nom'].value, os.environ['HTTP_USER_AGENT'])


Stéfane Fermigier

Transparent n. 14