NickG21 Posted December 28, 2006 Share Posted December 28, 2006 hey everyone, i have a pricing site that i am trying to make have capabilities of reloading with all prices in euros, lyra, etc.... and back to USD depending on the symbol clicked by the user. is there any php scripts written that will produce a result like this? if not, could someone try and point me in a general direction of how to accomplish this?thank you Quote Link to comment https://forums.phpfreaks.com/topic/32111-solved-dynamic-reload/ Share on other sites More sharing options...
onlyican Posted December 28, 2006 Share Posted December 28, 2006 Depend how much PHP you knowPersonally, I would store the Currency in a SessionThen show the price Depending the the currency SessionFor example[code]<?php$CurrencySymbols = array( 1 => "\$", 2 => "€", 3 => "£");//Examples Made Up$CurrencyExchangeRate = array(1 => 0, 2 => 0.6, 3 => 0.4);$_SESSION["CurrencyID"] = isset($_SESSION["CurrencyID"]) ? $_SESSION["CurrencyID"] : 1;$ItemPrice = 80;$CurrencyPrice = $ItemPrice * $CurrencyExchangeRate[$_SESSION["CurrencyID"];echo $CurrencySymbols[$_SESSION["CurrencyID"].$CurrencyPrice;?>[/code]and to change the CurrencyIDAt the top of the script[code]if(isset($_GET["currencyID"])){if(is_numeric($_GET["currencyID"]){$_SESSION["CurrencyID"] = $_GET["currencyID"];}}<a href='".$_SERVER['PHP_SELF']."?currencyID=1'>USD</a><br /><a href='".$_SERVER['PHP_SELF']."?currencyID=2'>Euro</a><br /><a href='".$_SERVER['PHP_SELF']."?currencyID=3'>British Sterling</a><br />[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32111-solved-dynamic-reload/#findComment-149012 Share on other sites More sharing options...
NickG21 Posted December 29, 2006 Author Share Posted December 29, 2006 if anyone can further elaborate for me on what exactly this code means with sessions i would appreciate it. i understand what it is doing but do not understand exactly how it runs through and reloads the site with the altered prices??thank you Quote Link to comment https://forums.phpfreaks.com/topic/32111-solved-dynamic-reload/#findComment-149321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.