You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
440 B

  1. import urllib2, urllib
  2. def getDate(id):
  3. dbdata = [('id', id), ('value', 'Products'),('content','BBD')] # The first is the var name the second is the value
  4. dbdata = urllib.urlencode(dbdata)
  5. path = 'http://10.10.3.81/database/communication/comm.php' # the url you want to POST to
  6. req = urllib2.Request(path, dbdata)
  7. req.add_header("Content-type", "application/x-www-form-urlencoded")
  8. page = urllib2.urlopen(req).read()
  9. return page