July 11th, 2000, 06:51 PM
Is it possible to code a PHP script that will get the balance of a PayPal account and display it in a different web site? This is necessary for a setting in which the moneys donated to a certain account should be visible, real time.
Thanks for taking the time.
PS: if PHP doesn't work, what can?
July 11th, 2000, 08:30 PM
>>that will get the balance of a PayPal account
What is PayPal account? How do you interact with it?
>>display it in a different web site?
Note, display it in a different site doesn't make it real time. By all means, it can't be displayed without someone visiting your other site. When someone visits your other site, it displays the up-to-second balance is called real time.
July 11th, 2000, 09:32 PM
Thanks for replying. What I mean with 'display at another site' is displaying it in a site other than PayPal's. Of course someone will visit my site and the script will fetch the balance off of PayPal. I need something like the scripts that fetch Slashdot, Linux Today etc. headlines, but the problem is I don't really know how PayPal handles displaying the balance since it is using its own script which is not visible in the source.
By the way, PayPal is a free service that allows users to beam money to e-mail addresses (of other PayPal members naturally).
Thanks a lot
July 11th, 2000, 09:51 PM
>>PayPal handles displaying the balance since it is using its own script
That is fine. You are trying to fetch the html output of PayPal site for your account, right?
Have you tried to use "fopen" to fetch the document by URL?
Well, if a login is required and the output should be displayed by a POST method, you are probably out of luck using PHP.
Let say you are to fetch linuxtoday headlines, then you can preform such task with GET method. PHP's fopen can do such task.
If a login is required either via a form post or htaccess prompt, you then have to use Perl modules. Go to http://www.perl.com/CPAN-local/modules/by-module/LWP/ and get libwww-perl-5.48.tar.gz
Here is an example -> http://www.devshed.com/Talk/Forums/F...ML/000182.html
Of course, to grab a particular line of a page, you need to do some filtering.
July 11th, 2000, 10:21 PM
Yes, a password IS involved. I will look into the perl link.
July 11th, 2000, 10:54 PM
>>Yes, a password IS involved. I will look into the perl link.
To be more specific, you should take a look at HTTP/Request/Common.pm starting from line 224.
libwww-perl package was meant to do advance tasks which PHP can't do presently. This is PHP forum, so I don't want to continue further. Just use the right tool for the right task and good luck.
July 11th, 2000, 11:30 PM
I 'will' look into it, but I don't think it will work because the server requires the user to have cookies enabled and the cookie is meant to identify the owner of the account. Even if I could manage to have the cookie set on the user's machine, then he/she would be able to access my account since he/she will be having the cookie. Also the link is 'https' , I don't know how that effects things. Thanks a lot for everything. I will probably have a hard coded thing which I will update frequently.