Bonjour, je me mets à essayer les possibilités qu'offre python sur le WEB :mouarf:
Cependant j'ai un problème, j'ai une page html comme ceci :
J'ai ajouté ceci dans mon fichier .htacces :Code:
1
2
3
4
5
6
7
8
9
10
11
12
13 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>test</title> </head> <body> <form action="http://xxxxxxx.fr/cgi-bin/Upload.py" method="post"> <input type="file" name="filename" /> <input type="submit" value="Upload" /> </form> </body> </html>
Le script Upload.py contient ceci :Code:
1
2 AddType text/x-python py AddHandler python-program .py
Le script se trouve dans le dossier cgi-bin (droits a 755) mais lorsque je clique sur le bouton "Upload" au lieu d'exécuter le script Upload.py , il me propose de l'ouvrir ou de l'enregistrer sur ma machine....Pourquoi ??? :cry:Code:
1
2
3
4
5
6
7
8
9
10 # -*- coding: cp1252 -*- #!/usr/bin/python print "Content-type: text/html\n\n" print "<html><head><title>Test cgi python </title></head><body>\n" print "Hello World" print "</body></html>"
HELP !!! Je débute vraiment sur python lié WEB :oops: