Hello,
I have a problem with reading output of submited page. There is a page which i need to open and read it's output fields:
https://www.e-gold.com/acct/balance.asp ... ase=654321
It's a link to check e-gold balance automaticaly, without need to login. This page has an output field which is named "Gold_Ounces". I need to get it's value. How can i do this?
Thanks for any help
reading output - help
Moderator: General Moderators
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
No, that link is working and there is no need for turing numbers. Of course this isn't the real link. I can't put my own id and passwordMaugrim_The_Reaper wrote:The page you're referring to has a CAPTCHA check (Turing Number they're calling it). This is likely preventing your auto-login attempts which is pretty much exactly what it's supposed to do.
I'm straw-grasping your exact objective here...
This is working, it opens balance, but i only need to get it.
There is some info about what fields are there when submiting:
http://www.e-gold.com/docs/e-gold_automation.html
also, there is a perl script. Maybe with that it would be easily to understand hoew to do that, but i don't have any idea about perl language and i don't know how to change it's contents into php language to make it work in php.
Here is that script:
http://www.e-gold.com/unsecure/scripts/balance.txt
I hope someone will know how to do it. There has to be some way to read output of submited page.
Thanks for any help
If url wrappers are enabled you can read data via http. The parameter allow_url_fopen in the output of phpinfo() will tell you wether you can use it or not.
According to the perl script you need to send you credentials as POST data. Which version of php do you use?
According to the perl script you need to send you credentials as POST data. Which version of php do you use?
You can use http://pear.php.net/manual/de/package.h ... client.php to send the credentials and retrieve the data.
Simple example: Sending the POST parameters a and b to http://localhost/yadda.php and displaying the response data
Simple example: Sending the POST parameters a and b to http://localhost/yadda.php and displaying the response data
Code: Select all
<?php
require 'HTTP/Client.php';
$c = new HTTP_Client;
$postdata = array(
'a'=>'1234',
'b'=>'9876'
);
$responsecode = $c->post('http://localhost/yadda.php', $postdata);
if ( PEAR::isError($responsecode) ) {
die('error: '.$responsecode->getMessage());
}
else if ( 200!=$responsecode ) {
die('http code: '.$responsecode);
}
else {
$response = $c->currentResponse();
echo htmlentities($response['body']);
}
?>