Does anyone know where I can get a PHP currency converter?
Adrian
12 3255
Erm... from Google?
(plus or minus 20 characters :P)
Erm... from Google?
(plus or minus 20 characters :P)
Ha ha .... ha! You think I didn't try Google? :p
I did find a few, but they required registring to some site. Blech! And even when I did, I didn't get an email for at least an hour. Actually, I stopped looking after that. I gave them my spam account anyway. ;)
When I tried using different key words I finally found some. I think the words were: Ajax, currency and converter. Pain in the ass trying to find somethings. :(
But I did find it. Thanks.
Adrian
Ha ha .... ha! You think I didn't try Google? :p
I did find a few, but they required registring to some site. Blech! And even when I did, I didn't get an email for at least an hour. Actually, I stopped looking after that. I gave them my spam account anyway. ;)
When I tried using different key words I finally found some. I think the words were: Ajax, currency and converter. Pain in the ass trying to find somethings. :(
But I did find it. Thanks.
Adrian
Ermmm. What currencies are you trying to convert?
Do you need them updated in real time?
I bet I could whip something up real fast.
-
<html>
-
<head><title>Motoma Pwnz0rz teh curency!!!!!11one
-
</title></head>
-
</body>
-
<form method="post">
-
-
<?php
-
$currArr = array( 'Dollars' => 1, 'Euros' => .78, 'Linden' => 1000);
-
-
if(isset($_POST['submit']))
-
{
-
$textBox = '<input type="text" name="dollars" value="'.$_POST['dollars'].'" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value)
-
{
-
if($_POST['currency'] == $value) $optionBox .= '<option value='.$value.' selected>';
-
else $optionBox .= '<option value='.$value.' >';
-
$optionBox .= $name;
-
}
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" value="'.$_POST['dollars'] * $_POST['currency'].'">';
-
}
-
else
-
{
-
$textBox = '<input type="text" name="dollars" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value) $optionBox .= '<option value='.$value.' >'.$name;
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" />';
-
}
-
-
echo $textBox.$optionBox.'<input type="submit" name="submit">'.$result;
-
?>
-
-
</form>
-
</body>
-
</html>
-
Don't make fun of me if it doesn't work.
-
<html>
-
<head><title>Motoma Pwnz0rz teh curency!!!!!11one
-
</title></head>
-
</body>
-
<form method="post">
-
-
<?php
-
$currArr = array( 'Dollars' => 1, 'Euros' => .78, 'Linden' => 1000);
-
-
if(isset($_POST['submit']))
-
{
-
$textBox = '<input type="text" name="dollars" value="'.$_POST['dollars'].'" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value)
-
{
-
if($_POST['currency'] == $value) $optionBox .= '<option value='.$value.' selected>';
-
else $optionBox .= '<option value='.$value.' >';
-
$optionBox .= $name;
-
}
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" value="'.$_POST['dollars'] * $_POST['currency'].'">';
-
}
-
else
-
{
-
$textBox = '<input type="text" name="dollars" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value) $optionBox .= '<option value='.$value.' >'.$name;
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" />';
-
}
-
-
echo $textBox.$optionBox.'<input type="submit" name="submit">'.$result;
-
?>
-
-
</form>
-
</body>
-
</html>
-
Don't make fun of me if it doesn't work.
HA-HA! (bully from the Simpsons) ;)
I've not tried it, but I would like it to convert all different types. Apperently, the one I've got and am still looking at will download a csv file from yahoo's finantial pages and then it will be able to convert and update using AJAX.
I'm still trying to get it to work. :(
Adrian
HA-HA! (bully from the Simpsons) ;)
I've not tried it, but I would like it to convert all different types. Apperently, the one I've got and am still looking at will download a csv file from yahoo's finantial pages and then it will be able to convert and update using AJAX.
I'm still trying to get it to work. :(
Adrian
You could do the same thing with mine: use fopen and fgetcsv to read the CSV file, and write the data to an associative array. Take the input currency, convert to a standard medium, and convert to your output currency.
I like the associative array method better, as it is easier to use: you don't need to keep track of every currency's exchange rate with every other currency (an n squared problem). Instead you keep track of every currency in relation to a base (in my case, dollars) and do all conversions with that.
The basic algorithm would be:
(source amount) / (source rate) * (currency rate)
-
<html>
-
<head><title>Motoma Pwnz0rz teh curency!!!!!11one
-
</title></head>
-
</body>
-
<form method="post">
-
-
<?php
-
$currArr = array( 'Dollars' => 1, 'Euros' => .78, 'Linden' => 1000);
-
-
if(isset($_POST['submit']))
-
{
-
$textBox = '<input type="text" name="dollars" value="'.$_POST['dollars'].'" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value)
-
{
-
if($_POST['currency'] == $value) $optionBox .= '<option value='.$value.' selected>';
-
else $optionBox .= '<option value='.$value.' >';
-
$optionBox .= $name;
-
}
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" value="'.$_POST['dollars'] * $_POST['currency'].'">';
-
}
-
else
-
{
-
$textBox = '<input type="text" name="dollars" />';
-
$optionBox = '<select name="currency">';
-
foreach($currArr as $name => $value) $optionBox .= '<option value='.$value.' >'.$name;
-
$optionBox .= '</select>';
-
$result = '<input type="text" name="result" />';
-
}
-
-
echo $textBox.$optionBox.'<input type="submit" name="submit">'.$result;
-
?>
-
-
</form>
-
</body>
-
</html>
-
Don't make fun of me if it doesn't work.
you could at least have made it possible for users to specify the conversion rates ...
Hi,
did you take a look at xe.com ? xe.com
Purple
Hi,
did you take a look at xe.com ? xe.com
Purple
Long form to fill in but the screen shot looks better than motoma's!
Long form to fill in but the screen shot looks better than motoma's!
You think you're pretty smart, what with your 5000 posts eh? Won't be feeling so spiffy once I go and delete all of your posts. You'll be sitting there with roughly a dozen in your name.
You think you're pretty smart, what with your 5000 posts eh? Won't be feeling so spiffy once I go and delete all of your posts. You'll be sitting there with roughly a dozen in your name.
Don't forget my arm is longer than yours and reaches all the small and nasty corners.
Don't forget my arm is longer than yours and reaches all the small and nasty corners.
Meh.
'nuff said.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: techy techno |
last post by:
hii Experts..!!
I need someone to tell me where I can get a Currency Converter like
http://cconv.textor.com
please can someone tell me where I can get it
I need it for free + I dont need...
|
by: meenasamy |
last post by:
Hi all, i need to create a function that takes three parameters(
Original currency, needed currency, amount) i need to convert from the
original currency to the needed currency the amount and...
|
by: Rash33d |
last post by:
Hi there! could som1 please help me out? i need toknow if there's
something wrong with this javascript code. The code is meant to give
the american dollar and european equivalent of a price. i.e...
|
by: jayender.vs |
last post by:
Hello guys,
I need to know the Currency conversion code in Javascript
Say for example i got 2 textbox .. where i enter a number (singapore
doller value) and i provide a button and in the next text...
|
by: Raj |
last post by:
Is there a current converter web service available?
Currency rates are to be as per latest exchange rates.
Raj.
|
by: xjohnx |
last post by:
Hi, I'm hoping someone can help me I am quite new to Javascript and have had to create a programme which converts dollars into euros and vice versa, here is my script which is working
var...
|
by: mereba |
last post by:
Hello
My country Ghana is changing its currency. I want to write a small
programme in C++ that can covert from the old currency into the new
one. I would like this programme to run behind a simple...
|
by: tararreb |
last post by:
#include<stdio.h>
/*This line is standard input output, # is directive, include is keyword, and stdio.h is header file*/
#include<stdlib.h>
/*This line is standard input output, # is directive,...
|
by: katie20 |
last post by:
Hi everyone,
I have written a code in order to produce a currency converter. My program will be designed to convert pounds into euros using visual basic programming. I have two text boxes and one...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |