| Jedijds wrote: |
| How could I make upgrades that my player could buy from a store? Could someone show me to a tutorial? Or make on? |
| Code: |
|
# needed for sending data routines import httplib #values we want to send username = "JOHN" score = 1230 print "connecting...", # connect to the server just as the browser do - to the 80 port. con = httplib.HTTPConnection("yoursite.com", 80) print "ok" print "sending request...", # send the GET request, note the path to the script doesn't start from server name, the path is absolute. # we send data after ? as variablename=variablevalue separated by & con.request("GET", "/somescript.php?username="+str(username)+"&score="+str(score)); print "ok" #get response from server - status codes here: http://www.w3.org/Protocols/HTTP/HTRESP.html # 200 means OK resp = con.getresponse() print resp.status, resp.reason |