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



[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 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



[PHP] Re: parsing useragent string without get_browser

2005-08-25 Thread I. Gray

The problem is I haven't seen any examples of this in php.

The best I have come up with is the following. I know the code is pants, 
but it works. I am sure people out there can think of a better way of 
doing it-


$ua = $logInfo[useragent];
		if ( ereg(Firefox/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if ( ereg(MSIE [0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if ( 
ereg(Bloglines/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, $ua, 
$array)) {$browser = $array[0];}
		if ( 
ereg(Amfibibot/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, $ua, 
$array)) {$browser = $array[0];}
		if ( ereg(msnbot/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if ( 
ereg(Googlebot/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, $ua, 
$array)) {$browser = $array[0];}
		if ( ereg(Safari/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if ( 
ereg(Konqueror/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, $ua, 
$array)) {$browser = $array[0];}
		if ( ereg(Netscape/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if ( 
ereg(Thunderbird/[0-9]{1,2}[\.]{0,1}[0-9]{0,4}[\.]{0,1}[0-9]{0,4}, 
$ua, $array)) {$browser = $array[0];}
		if		(strpos($ua, Web RSS Reader)!== FALSE) {$browser = Web RSS 
Reader;}

if  (strpos($ua, BDFetch)!== FALSE) {$browser = 
BDFetch;}
		if		(strpos($ua, www.almaden.ibm.com/cs/crawler)!== FALSE) {$browser 
= Web Fountain;}

if  (strpos($ua, sohu-search)!== FALSE) {$browser = 
Sohu Search;}
if  (strpos($ua, Yahoo! Slurp)!== FALSE) {$browser = 
Yahoo! Slurp;}
if  (strpos($ua, Windows NT 5.1)) {$platform = 
Windows XP;}
elseif  (strpos($ua, Windows NT 5.0)) {$platform = Windows 
2000;}
		elseif	(strpos($ua, Windows 98) OR strpos($ua, Win98)) {$platform 
= Windows 98;}
		elseif	(strpos($ua, Windows 95) OR strpos($ua, Win95)) {$platform 
= Windows 95;}
		elseif	(strpos($ua, Win16) OR strpos($ua, Windows 3.1)) {$platform 
= Windows 3.1;}

elseif  (strpos($ua, Mac OS X)) {$platform = Mac OSX;}
elseif  (strpos($ua, Linux)) {$platform = Linux;}

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



[PHP] parsing useragent string without get_browser

2005-08-24 Thread I. Gray

I've done a google and can't find anything on this.

I want to parse a long list of useragent strings for a web analysis 
script I am writing. I could use get_browser, but firstly this would 
slow down my script quite a bit and secondly I am relying on the 
browscap.ini file of the newness of which is upto my ISP as I am on 
shared hosting.  Is there are a way of doing this?


I'd like to break down the string into it's componant parts but the 
difference in strings is big. eg-


Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; stumbleupon.com 1.927)

Windows-Media-Player/10.00.00.3650

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 
Firefox/1.0.4


Mozilla/5.0 (compatible; Yahoo! Slurp; 
http://help.yahoo.com/help/us/ysearch/slurp)


Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/312.1 
(KHTML, like Gecko) Safari/312


How do I start with this one?

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



[PHP] PHP script for removing/forwarding suspected spam from pop3 mailbox

2005-08-11 Thread I. Gray

Hi.

I'd like to find or write a script that I can run every so often (hourly 
for example) from cron that will check my pop3 mailboxes for any emails 
with SPAM in the subject line and either delete them or forward 
them to another email address.  The best way would be to bundle all the 
emails together and forward these as attachments to another email 
address that I would use as spam.


I have found the documentation on using php for pop3 a little confusing 
as it seems to be geared towards imap. I know it can be used for pop3 
it's just the documentation on this seems to be a little scarce. Can 
anyone help me find an already written script or give me some ideas on 
how I can write my own.


Many thanks,

IG

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



[PHP] resetting arrays

2005-06-21 Thread I. Gray

Hi.

I am sure this is easy, but I can't get this work.  Is there not a php 
function that can do this?


I have an array- for example...
[1] = Yellow
[2] = Green
[3] = Purple
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

What happens, say if I delete [3] = Purple?  I get...

[1] = Yellow
[2] = Green
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

But what if I want to reset the numbers? Like...

[1] = Yellow
[2] = Green
[3] = Blue
[4] = Red
[5] = Orange
[6] = Cyan

I've tried this...

unset($ses_basket_items[$pos]); for ($ii=0; 
$iicount($ses_basket_items); $ii++) {if (isset($ses_basket_items[$ii])) 
{$cc++; $arry_a[$cc] = $ses_basket_items[$ii]; }} $ses_basket_items = 
$arry_a;


where $pos is the position of the array I want to get rid of. 
$ses_basket_items is session variable, does that matter?


Please help.

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



Re: [PHP] resetting arrays

2005-06-21 Thread I. Gray

Thanks Richard,

I had thought of sort.  It almost does what I want, and really simply 
and neat. However it sorts the array alphabetically, and I would prefer 
to have things in the same order. Is there another way?


Ian Gray

Richard Davey wrote:

Hello,

Tuesday, June 21, 2005, 1:33:55 PM, you wrote:

IG I have an array- for example...
IG What happens, say if I delete [3] = Purple?  I get...
IG But what if I want to reset the numbers? Like...

?php
$array = array(0 = 'a', 1 = 'b', 2 = 'c', 3 = 'd', 4 = 'e');
print_r($array);

unset($array[3]);

print_r($array);

sort($array);
print_r($array);
?

Best regards,

Richard Davey


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



[PHP] Re: resetting arrays

2005-06-21 Thread I. Gray

Thanks Al,

That's done it!

unset($ses_basket_items[$pos]); $ses_basket_items  = 
array_values($ses_basket_items) ;


They aren't big arrays so I suppose I shouldn't worry about exceeding 
memory limits - 
http://uk2.php.net/manual/en/function.array-values.php#36837  ?


My only problem now is that I can't seem to delete the first value of 
the array.


$basket is the item I want to delete from the array $baskitems

if (array_search($basket, $baskitems) != FALSE) {
$pos = array_search($basket, $baskitems);
unset($ses_basket_items[$pos]); $ses_basket_items  = 
array_values($ses_basket_items) ;

}





Al wrote:

I. Gray wrote:


Hi.

I am sure this is easy, but I can't get this work.  Is there not a php 
function that can do this?


I have an array- for example...
[1] = Yellow
[2] = Green
[3] = Purple
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

What happens, say if I delete [3] = Purple?  I get...

[1] = Yellow
[2] = Green
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

But what if I want to reset the numbers? Like...

[1] = Yellow
[2] = Green
[3] = Blue
[4] = Red
[5] = Orange
[6] = Cyan

I've tried this...

unset($ses_basket_items[$pos]); for ($ii=0; 
$iicount($ses_basket_items); $ii++) {if 
(isset($ses_basket_items[$ii])) {$cc++; $arry_a[$cc] = 
$ses_basket_items[$ii]; }} $ses_basket_items = $arry_a;


where $pos is the position of the array I want to get rid of. 
$ses_basket_items is session variable, does that matter?


Please help.



array_values()


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



Re: [PHP] Re: resetting arrays

2005-06-21 Thread I. Gray
Agggh, I feel stupid now. I keep on forgetting to use the double equal 
sign...


Thanks everyone, it is all working now!

Shaw, Chris - Accenture wrote:

Use !==

if (array_search($basket, $baskitems) !== FALSE) {
$pos = array_search($basket, $baskitems);
unset($ses_basket_items[$pos]); $ses_basket_items  =

array_values($ses_basket_items) ;

-Original Message-
From: I. Gray [mailto:[EMAIL PROTECTED]
Sent: 21 June 2005 14:21
To: php-general@lists.php.net
Subject: [PHP] Re: resetting arrays


*

This e-mail has been received by the Revenue Internet e-mail service.

*

Thanks Al,

That's done it!

unset($ses_basket_items[$pos]); $ses_basket_items  =

array_values($ses_basket_items) ;

They aren't big arrays so I suppose I shouldn't worry about exceeding

memory limits -

http://uk2.php.net/manual/en/function.array-values.php#36837  ?

My only problem now is that I can't seem to delete the first value of

the array.

$basket is the item I want to delete from the array $baskitems

if (array_search($basket, $baskitems) != FALSE) {
$pos = array_search($basket, $baskitems);
unset($ses_basket_items[$pos]); $ses_basket_items  =

array_values($ses_basket_items) ;
}





Al wrote:


I. Gray wrote:





Hi.

I am sure this is easy, but I can't get this work.  Is there not a php




function that can do this?

I have an array- for example...
[1] = Yellow
[2] = Green
[3] = Purple
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

What happens, say if I delete [3] = Purple?  I get...

[1] = Yellow
[2] = Green
[4] = Blue
[5] = Red
[6] = Orange
[7] = Cyan

But what if I want to reset the numbers? Like...

[1] = Yellow
[2] = Green
[3] = Blue
[4] = Red
[5] = Orange
[6] = Cyan

I've tried this...

unset($ses_basket_items[$pos]); for ($ii=0;




$iicount($ses_basket_items); $ii++) {if




(isset($ses_basket_items[$ii])) {$cc++; $arry_a[$cc] =




$ses_basket_items[$ii]; }} $ses_basket_items = $arry_a;

where $pos is the position of the array I want to get rid of.




$ses_basket_items is session variable, does that matter?

Please help.






array_values()



--

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







This message has been delivered to the Internet by the Revenue Internet e-mail 
service

*


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



Re: [PHP] Re: So many returned mail notices!

2005-06-21 Thread I. Gray
I think many of us on this mailing list would be grateful if there was a 
little less nastiness going around. If someone is 'ignorant' then there 
are nicer ways of putting it.





My point is if you dont like spam do something about it, clearly your 
too ignorant to understand.


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



[PHP] Re: retreiving postal/zip codes with PHP

2005-06-15 Thread I. Gray

I. Gray wrote:

Hi.

I was wandering whether anyone knew how i can use php to retrieve info 
from a postal code (probably mainly in the UK) so that when a person 
enters the post code it comes up with the address or I can do other 
things with the info.  Is there a php class that can do this? Would I 
need to use a database of postal info? If so are there any (preferably 
free) ones?


Thanks everyone.

The Royal Mail, I don't think will stop charging for the service.  I 
wish there was a decent world wide database that was free to use.


Many websites out there use some kind of database.  The website 
www.faxyourmp.co.uk uses one, and since they don't make any money from 
this (well I can't see how they can) then will they be paying for a post 
code database?


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



[PHP] retreiving postal/zip codes with PHP

2005-06-14 Thread I. Gray

Hi.

I was wandering whether anyone knew how i can use php to retrieve info 
from a postal code (probably mainly in the UK) so that when a person 
enters the post code it comes up with the address or I can do other 
things with the info.  Is there a php class that can do this? Would I 
need to use a database of postal info? If so are there any (preferably 
free) ones?


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



[PHP] Re: Retrievable weather service info?

2005-06-14 Thread I. Gray
You might want to have a look at 
http://www.accuweather.com/wx/accunet/index.htm


Not checked it out properly, but give it a go. Don't think it's free 
though. Anyone got any other ideas?



Murray @ PlanetThoughtful wrote:

Hi All,

Just wondering if anyone knows of a free weather service that can be
interrogated by PHP for information such as current temperature for a range
of cities around the world?

Regards,

Murray


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



[PHP] include()

2005-06-13 Thread I. Gray

Hi

Just a quickie.

Is there a big difference between me including a file by putting the url 
in the include() such as 
include(http://www.examplesite.com/examplefile.php) and putting the 
server path such as 
include(number/www.examplesite.com/public_html/examplefile.php) ?


I want to get into good habits you see.

I assume I have to use the first example when the file is on a different 
server.


Many thanks.

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