What is the best way to do this?

Results 1 to 2 of 2

Thread: What is the best way to do this?

  1. #1
    Join Date
    Dec 1969

    Default What is the best way to do this?

    I have a site where I want to let the user select which language they want to view in, and which currency they see the prices in (see to view) When selecting the currency I obviously need to factor the price by a conversion rate, and also display relevant text/characters to show the currency.<BR><BR>What is the best way to go about this. I don&#039;t want to reference the datanase on every page view to grab these values do I? Where should I store them so that they can be easily referenced on any page. Also they need to revert to the default when the visitor next visits.<BR><BR>I have tried Session variables but am having trouble getting these to be referenced in a function to do the work (just to keep the ASP tidier).<BR><BR>Any help greatly appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: What is the best way to do this?

    Maybe this will help:<BR><BR>http://www.aspmessageboard.com/forum/showMessage.asp?F=20&M=277764&P=1<BR><BR>For the text from the DB you could select the correct column from the DB, like this:<BR><BR>Table products:<BR><BR>ProductID, Machinecode, en_Description, ge_description [etc.]<BR><BR>You put the English description in the column en_Description and the German description in the column ge_description etc. etc.<BR><BR>sSQL = "SELECT " & Session("language") & "_description FROM products WHERE machinecode = &#039;XBOX&#039;"<BR><BR>For the currency you could set an sessionvar and use it like this<BR><BR>response.write ("Your price = " & dblPrice * Cdbl(Session("currencyvalue")) & session("Currency") )<BR><BR>Maybe this will get you started.<BR><BR>As for the functionproblems, I&#039;m not sure what goes wrong. You *SHOULD* be able to access an sessionvar in an function. How do you call the functions??<BR><BR>Good luck<BR><BR>Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts