Page 1 of 1
Read in html from website?
Posted: Mon May 23, 2005 11:45 pm
by Jeslyn
Hi everyone...need alittle help urgently..
I'm currently doing a program which may need to obtain real time updates on exchange rates from a certain reliable website. I know it can be done in java using openConnection() and stuff..is there a way to do it using php?
thanx alot in advance

Posted: Tue May 24, 2005 12:46 am
by Revan
ReadFile() to download a file from a site, and parse it.
fsockopen() if it's some kind of API.
Posted: Tue May 24, 2005 2:30 am
by anjanesh
Use
file_get_contents() and then parse it using
RegExp
Posted: Tue May 24, 2005 9:22 am
by Jeslyn
thanx for the reply...but i'm kinda new in this...
i can't seem to get it to work...i tried file_get_contents, fopen...etc
but the $handle which fopen returns seems to be false..
this is the website i'm trying to read..."
http://www.dbs.com/ratesonline/fxbra.html"
Basically i've to read the html source of this webby into a string...
den extract what i need from it.
the extraction part should be fine...i just need to read the html source from that webby into a string...
Thanks once again

Posted: Tue May 24, 2005 12:01 pm
by ody
Jeslyn wrote:thanx for the reply...but i'm kinda new in this...
i can't seem to get it to work...i tried file_get_contents, fopen...etc
but the $handle which fopen returns seems to be false..
this is the website i'm trying to read..."
http://www.dbs.com/ratesonline/fxbra.html"
Basically i've to read the html source of this webby into a string...
den extract what i need from it.
the extraction part should be fine...i just need to read the html source from that webby into a string...
Thanks once again

Does the server in question have direct routing?
Posted: Tue May 24, 2005 1:08 pm
by phpScott
does the site owner allow this sort of thing would be my big question for you.
Posted: Tue May 24, 2005 1:30 pm
by shiznatix
after seeing this question asked about once a day i think there should be a sticky post about getting a websites content then using preg to get what you want so hopefully this question dosnt come up so often
Posted: Wed May 25, 2005 7:28 am
by Jeslyn
thanx for the replies...
i cld do it in java...so i dun tink it's the site's problem...
"$handle = fopen($url, 'r')" doesn't seem to work...any ideas?

Posted: Wed May 25, 2005 8:47 am
by Jeslyn
really sorry guyz...
i realised the mistake was somewhere else...
yupz...the code works...
thanx alot everyone
