Python to PHP Login System (HTTP Post)

test at test.test test at test.test
Thu Jun 22 02:42:02 CEST 2006


Hi everyone,

I'm creating a desktop Python application that requires web-based
authentication for accessing additional application features.

HTTP GET is really simple.
HTTP POST is not (at least for me anyway)    ;)

I have tried a few different sources, but I cannot get HTTP POST to
successfully log in. I can login  using FireFox at
http://www.magnetshare.com/main.php

I suggest you register a dummy login to see what I mean (don't enter
your real e-mail address).

Now here's some code:
------------------------------------------------------------------------------
msparams = urllib.urlencode({'user': self.components.User.text,
'pass': self.components.MagnetSharePassword.text, 'sublogin': '1'})
        try:
            f = urllib()   ***What should go here?***
            fc = f.read()
            fc.close()
        except:
            self.statusBar.text = "Disconnected"
            result = dialog.alertDialog(self, 'Couldn\'t connect to
MagnetShare.com! Please check your Internet connection, and then try
again.')
        else:
            print fc
-------------------------------------------------------------------------------

Also, could you let us know what modules we should import?
Thanks for checking this out!

By the way, the PHP system I'm using is super easy to set up:

http://www.evolt.org/article/PHP_Login_System_with_Admin_Features/17/60384/index.html



More information about the Python-list mailing list