Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- HIding Javascript


usavetele - 3:17 am on Jul 12, 2005 (gmt 0)


Wow! That's a really interesting idea!

Not only do I know next to nothing about Javascript (no laughing!), but I know NOTHING about PHP. I'm learning though! Anyway, here goes the stupid questions:

Where does the following coding go ("script.php" file?)
function getUSD($price) { $exchRate = 1.20379; $USD = '<b>USD $' . number_format($price * $exchRate,2) . '</b>'; return $USD; }

Also, is it possible to duplicate this function on the same page numerous times? I'm wanting to also convert prices from EURO to GBP, YEN and CAD. Is it as simple as changing the USD in the coding you suggested to GBP, etc. and then naming those files different than script.php?

I couldn't get the coding you gave me to work because I didn't know what to insert in the header and where to insert this coding:

function getUSD($price) { $exchRate = 1.20379; $USD = '<b>USD $' . number_format($price * $exchRate,2) . '</b>'; return $USD; }

This is exciting if I can use coding that is much shorter. Very interesting!Thanks so much for your help.


Thread source:: http://www.webmasterworld.com/php/9105.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com