Python to PHP Login System (HTTP Post)

test at test.test test at test.test
Fri Jun 23 06:00:22 CEST 2006

On 22 Jun 2006 16:19:50 -0700, "Justin  Azoff"
<justin.azoff at> wrote:

>Jeethu Rao wrote:
>> You need to use httplib.
>> Jeethu Rao
>Not at all.  They need to read the documentation for urrlib:
>"The following example uses the "POST" method instead:"....
>Additionally, they probably need to use cookielib, otherwise the logged
>in state will not be persistant.

Here's what's strange... I tried using urllib like this:
	msparams = urllib.urlencode({'user':
self.components.User.text, 'pass':
self.components.MagnetSharePassword.text, 'sublogin': 1})
	 f = urllib.urlopen("",
	fc =
	print fc
	self.statusBar.text = "Disconnected"
	result = dialog.alertDialog(self, 'Couldn\'t connect to! Please check your Internet connection, and then try
	print fc
...and then I visited to see if I
was logged in. Sure enough I was logged in, but the exception was
thrown anyway. I commented out the urlopen, f, and fc  lines and
tested it again. This time I made it to "else:"

I'm stumped. I'm glad that the user can log in; however, the
MagnetShare application needs to read in the response from the server,
and then decide what to do with the information.

More information about the Python-list mailing list