PHP help: Currency Converter

iosoft

PC enthusiast since MS DOS 5
Skilled
I need a PHP function that will convert Indian Rupee to US$ with taking real time currency rate from the internet ?

P.S. I don't want to paste a online calculator. I will get the rate from the remote server and automatically calculate.
 
So basically what you want is a PHP function that can retrive data off from a different server rite ??

If this is what you want to do then i would suggest using AJAX.
Here is the idea...

When a user presses a button to get converted value or leaves the field
(ie onblur() or onClick() function can be used to activate the AJAX method)

you can use the AJAX method to send a get request passing currency value as prameter and getting converted value as response.

as for the PHP file it will revcieve the value in $_GET[value],

and u can use any command line utility to get time from any server and stroing the result.

For executing a comand line utility use $exchange_rate = SHELL_EXEC(converter.exe);

this will store the output of CMD utility in ur variable $exchange_rate and now u can easily calculate :)
 
thanks for your guide, but, I also need to know from where can I get these rate ?
 
dont think xe provide data in the way you are looking for...may be you can use cURL to post on XE and parse the page output..and they dont use captcha so..should be easy
 
lokeshv said:
dont think xe provide data in the way you are looking for...may be you can use cURL to post on XE and parse the page output..and they dont use captcha so..should be easy

an example would be very very helpful ;)
 
Just finished doing it. needed it for a shop i was doing for a client. PM me know if you need it. btw XE says automatic extraction of data violates AUP :p
 
Back
Top