Re: [PHP] Php logging into online bank to get details automatically

2005-09-21 Thread I. Gray

Thanks, Jasper

I looked at my banks TCs and it says don't use software that stores 
your password unless it is used by a specific banking service.


I am going to look into the curl functions, but I am pretty sure that 
the bank won't let it work unless it thinks it is a proper browser like 
IE or Firefox, so can I change the useragent for this? If so, how do I 
do that?


My other concern is storing my password details. I could store them on a 
MYSQL database and encrypt it, but I just want to make sure that it is 
as secure as poss.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php logging into online bank to get details automatically

2005-09-21 Thread Jasper Bryant-Greene

I. Gray wrote:
I looked at my banks TCs and it says don't use software that stores 
your password unless it is used by a specific banking service.


You might like to send them an email to clarify; as a general rule your 
bank manager is the kind of person you least want to piss off ;)


I am going to look into the curl functions, but I am pretty sure that 
the bank won't let it work unless it thinks it is a proper browser like 
IE or Firefox, so can I change the useragent for this? If so, how do I 
do that?


Send the User-Agent header using the CURL function for setting a header 
( not sure exactly what it is, but it's in the curl docs 
http://php.net/curl ) containing whatever User-Agent string you wanted; 
just copy-pasting a Firefox or IE one would usually work fine.


My other concern is storing my password details. I could store them on a 
MYSQL database and encrypt it, but I just want to make sure that it is 
as secure as poss.


If you encrypt the password then your script has to know the key to 
decrypt it and the place to find the encrypted password, so it might as 
well just know the password...


If it's run by  a cronjob then you could run it as root, chown it to 
root and chmod it to 700 which would only allow root to read it. Then 
the password should be safe inside the script.


Doesn't this mean you'll be storing your password, just as their TCs 
prohibit? :)


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php logging into online bank to get details automatically

2005-09-21 Thread John Nichel

Jasper Bryant-Greene wrote:

John Nichel wrote:


I. Gray wrote:


I thought I may of read of this somewhere- but I may be wrong. I am also
not sure whether this is allowed by banks, so please let me know- I want
to stay on the right side of the law!



Your account...I can't see where it would be a problem with how you 
access it.



Here in New Zealand most banks have a clause in their Internet Banking 
terms of use saying that you may not use automated systems to access the 
banking system. Many of them include those silly CAPTCHA things to try 
and prevent them too.


So you can't use things like MS Money, Quickbooks, etc to access your 
account?  That sucks.



--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Php logging into online bank to get details automatically

2005-09-20 Thread I. Gray

Hi all.

I thought I may of read of this somewhere- but I may be wrong. I am also
not sure whether this is allowed by banks, so please let me know- I want
to stay on the right side of the law!

I'd like a php script to access my bank balances and send me an email
daily. I know how to set up cron and use the php mail feature, and to
parse web pages using php but the problem is reading a page in SSL and
putting info in multiple forms. For example my bank asks for two
security numbers then 2 digits from a password on the next page. Is it
possible to use php to do this? Is there a script out there which would
help me here. I have googled to try and find out but to no avail.

Thanks.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php logging into online bank to get details automatically

2005-09-20 Thread John Nichel

I. Gray wrote:

Hi all.

I thought I may of read of this somewhere- but I may be wrong. I am also
not sure whether this is allowed by banks, so please let me know- I want
to stay on the right side of the law!


Your account...I can't see where it would be a problem with how you 
access it.



I'd like a php script to access my bank balances and send me an email
daily. I know how to set up cron and use the php mail feature, and to
parse web pages using php but the problem is reading a page in SSL and
putting info in multiple forms. For example my bank asks for two
security numbers then 2 digits from a password on the next page. Is it
possible to use php to do this? Is there a script out there which would
help me here. I have googled to try and find out but to no avail.


Try cURL...it may help.  http://www.php.net/curl

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php logging into online bank to get details automatically

2005-09-20 Thread I. Gray
Curl- ahh, thanks not something I've looked into yet. Are there any 
other resources out there that I could look at for learning about it?


Thanks.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php logging into online bank to get details automatically

2005-09-20 Thread Jasper Bryant-Greene

John Nichel wrote:

I. Gray wrote:


I thought I may of read of this somewhere- but I may be wrong. I am also
not sure whether this is allowed by banks, so please let me know- I want
to stay on the right side of the law!


Your account...I can't see where it would be a problem with how you 
access it.


Here in New Zealand most banks have a clause in their Internet Banking 
terms of use saying that you may not use automated systems to access the 
banking system. Many of them include those silly CAPTCHA things to try 
and prevent them too.


IANAL, but you may want to have a close look at your bank's terms of use.


I'd like a php script to access my bank balances and send me an email
daily. I know how to set up cron and use the php mail feature, and to
parse web pages using php but the problem is reading a page in SSL and
putting info in multiple forms. For example my bank asks for two
security numbers then 2 digits from a password on the next page. Is it
possible to use php to do this? Is there a script out there which would
help me here. I have googled to try and find out but to no avail.


Try cURL...it may help.  http://www.php.net/curl


Even file_get_contents() and friends can access SSL URLs, provided PHP 
is compiled with SSL support, but they can't send POST requests which 
you need for logging in, etc.


So use CURL to post to the login form, and then get the session cookie 
that they send back, and send that along with your request for the 
balances page.


Once you've got the content of the page just apply string functions or 
some regex magic to get your balances, or go hardcore and try to parse 
their page with the DOM functions.


Remember that your code will likely break if they make substantial 
changes to their site design.


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php