[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] PHP



Jason Ward wrote:
Hey can you help me. I know nothing about php. Can I use it to put my pygame scripts on a
web page so that people can play them?
What is php?
Please explain in great detail.

I've been able to put a few simple Python projects online so that people can access them from a Web page. A few examples are at:
http://kschnee.xepher.net/generators


Basically, you have to make a program that calls "print" exactly once, printing out a valid piece of formatted HTML or text-with-header. The program can take input from a Web form using the GET or POST method.

See http://kschnee.xepher.net/code/cgitool.py.txt and
http://kschnee.xepher.net/code/treasure.py.txt

for (respectively) a utility and a simple demo of an online Python program.

Actually making the program run is a headache, because -- at least on the server I use -- you need to put the programs inside a special "cgi-bin" directory. Then you need to make sure the program is in Unix text format, and with the right permissions, which requires a specialized FTP program and the commands:
dos2unix something.py
chmod 700 something.py


Kris