PAccounts
Copyright (C) 1999 Dan Steinman (dan@dansteinman.com)
PAccounts is free software under the terms of the GNU General Public License

http://www.dansteinman.com/php/paccounts/

INSTRUCTIONS

PAccounts is a combination of two PHP3 scripts for creating a custom webpage that allows you to login to websites from a single click of a link.  An example use of this is to have one-click access to your web mail (Hotmail, YahooMail etc), or to automatically log into web discussion boards and so on.

In order to use PAccounts, you must be running a webserver with PHP3 support, and have access to a MySQL database.

PHP - http://www.php.net
MySQL - http://www.mysql.com/

The paccounts-class.php3 script is where most of the work is done - it's a class that handles all the dirty work that goes into parsing the form fields on a website and saving that information to the database.  The paccounts.php3 script is an example of how to use the PAccounts class to create a webpage to automatically log into your web accounts.  The default page has simple links with a JavaScript function to submit your username and password automatically.  It should be noted that this is not a secure way to save your passwords.  I would only recommend installing this on your local computer with a webserver.

PAccounts uses a small PHP library that wrote for my different PHP apps called DPLib - if you did not download DPLib you must do so now at http://www.dansteinman.com/php/dplib/.  Put the 2 dplib scripts in the same directory as the paccounts scripts.

The set up work you'll involves setting the MySQL hostname, username, password, and database name in BOTH the paccounts.php3 script, AND dplib-login.php3:

$mysql = new MySQLDatabase;
$mysql->setHost('localhost');  // sql server host name
$mysql->setUsername('myuser');  // sql server username
$mysql->setPassword('mypass');  // sql server password
$mysql->select_db('mydatabase'); // select database to store info

Once that's done you must create a user account for DPLib, visit the dplib-login.php3 and create a new account.  By default this will create a "users" database in your MySQL server (this could be changed within the dplib.php3 source if necessary).

After you create an account you should be brought to a simple page that says
"<username> was successfully logged in"

This puts 2 cookies in the browser named "cusername" and "cpassword" - PAccounts uses those cookies to grab the username/password, thus there is no login page for PAccounts.

As long as the cookies are present, when you visit paccounts.php3 you will be automatically logged in, and can then create new entries for your web accounts.  Click on "Make a new account" and enter a URL of any website which has a username/password login screen.  Hit submit, and wait a while for that url to be examined. A results page will show each form that is on the page and all the input data that is on it.  There might be more than 1 form, so take an educated guess which is the right one.  Enter a default "Account Name", this what will be the name shown in the PAccounts custom web login page.  Next you have to enter your username and passwords in the appropriate input fields.  These inputs will be of the Type "text".  The username input might have a name like "user", "username", "login", and the password input might have a name like "passwd", "pass" etc.

There will often be other inputs with wierd names, hidden fields and so on.  Most often you can leave the values at their default, but sometimes you might have to investigate to find an appropriate value. For example Hotmail requires JavaScript, there is an input named "js" with a default value of "no", if you manually type "yes" for the value then it works fine.

Then "Save" the account and try logging in.

Unfortunately some sites will not work, for example the MyEbay site didn't seem to.  It's usually not because of a bug, but rather the programmers of the website specifically prevented the ability to login from another website.

Have fun!

CHANGES

Version 0.1 (April 27, 2000)
	- first public release 

Dan Steinman
dan@dansteinman.com
www.dansteinman.com
