In the reality, I used on a apache this php-script to show
all of the transmitted VARs:
>> <html><body><pre>
>> POST-Vars:
>> <?php
>> while (list($key, $val) = each($HTTP_POST_VARS))
>> echo ("<b>$key:</b> $val \n");
>> ?>
>>
>>
>> GET-Vars:
>> <?php
>> while (list($key, $val) = each($HTTP_GET_VARS))
>> echo ("<b>$key:</b> $val \n");
>> ?>
>> </pre></body></html>
Now, with this simple HTML-Script, the POST-VAR was
always transmitted:
>> <html><body>
>> <form method="post" action="http://strebig.de/test.php">
>> <input type="text" name="val1" value="xxx">
>> <input type="submit" value="los">
>> </form>
>> </body></html>
...but this (my original) Pyhton-script failed.
>> import httplib, urllib
>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0})
>> h = httplib.HTTP("strebig.de")
>> h.putrequest("POST", "/test.php")
>> h.putheader("Content-length", "%d" % len(params))
>> h.putheader('Accept', 'text/plain')
>> #h.putheader('Host', 'xxx.com')
>> h.endheaders()
>> h.send(params)
>> reply, msg, hdrs = h.getreply()
>> #print msg
>> data = h.getfile().read()
>> print data
So far,
Markus
p.s.: the domain "strebig.de" is under construction :)
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython