473,799 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple setup for allowing visitors to choose their country

Hi

I need to be able to change the currency and some form fields displayed on
my website depending on where the visitor is based. I don't need a fully
functional cart, just a kinda either display '$10' or '£7' sort of thing!

I was planning on having a map on my opening screen with hotspots over the
countries. On the links for the hot spots I was planning to have something
like href="functions .php?FuncToExec =countrySelectU S"> in the functions.php i
was going to set a session variable to the country ie 'US' and then
automatically move to my normal page. Then in my forms etc I was planning on
using if statements to select price etc.

This seems rather long winded! Is it the right way to do it?
Thanks for any help given
NO


Oct 24 '05 #1
8 1621
"Nicole" <ni************ ***@yahoo.co.uk > wrote:
Hi

I need to be able to change the currency and some form fields
displayed on my website depending on where the visitor is based. I
don't need a fully functional cart, just a kinda either display '$10'
or '£7' sort of thing!
How many currencies?
I was planning on having a map on my opening screen with hotspots over
the countries.
World map? Are you going to support them all? Is every visitor able to find
his/her country on this map?
On the links for the hot spots I was planning to have
something like href="functions .php?FuncToExec =countrySelectU S"> in the
functions.php i was going to set a session variable to the country ie
'US' and then automatically move to my normal page. Then in my forms
etc I was planning on using if statements to select price etc.


php -> use a hash with the key the currency code, and the value the
conversion rate. If the key is undefined, report "bad currency", don't fix
it to a default (you might overlook a bug that way).

--
John Perl SEO tools: http://johnbokma.com/perl/
or have them custom made
Experienced (web) developer: http://castleamber.com/
Oct 24 '05 #2
Nicole <ni************ ***@yahoo.co.uk > wrote:
I need to be able to change the currency and some form fields displayed on
my website depending on where the visitor is based. I don't need a fully
functional cart, just a kinda either display '$10' or '£7' sort of thing!

I was planning on having a map on my opening screen with hotspots over the
countries.


That'll be popular with people from Singapore, Monaco, etc.

miguel
--
Hit The Road! Photos from 38 countries on 5 continents: http://travel.u.nu
Latest photos: Burma; Hong Kong; Macau; Amsterdam; Grand Canyon; Amman
Oct 24 '05 #3
Nicole wrote:

Hi I need to be able to change the currency and some form fields displayed
on
my website depending on where the visitor is based. I don't need a
fully
functional cart, just a kinda either display '$10' or '£7' sort of
thing!

I think the right way to do that would be using the GeoIP PHP API:

http://www.maxmind.com/app/php

This way you don't have to ask, just give them the custom layout based on
their IP Address. Not without its limitations, but think about
human-induced error factor: it is highly unlikely that you will get an
honest answer from a visitor coming from Russia, India, China or any other
place that online retailers don't like much. They know for the fact that
they will be treated badly and maybe even denied access to the site, so
why bother answering this question honestly? It's so easy to just pick
U.S.A. from the list you've provided.

--
Cheers,
Dmitri
See Site Sig Below
-------------------------------------

--
##-----------------------------------------------##
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
Web and RSS gateway to your favorite newsgroup -
alt.comp.lang.p hp,alt.php,alt.www.webmaster,comp.lang.php - messages and counting!
##-----------------------------------------------##
Oct 24 '05 #4
Hiya

As I said its a simple solution that needed. I wont be supporting all
countries, only the English speaking countries that I choose in the future
to do marketing in.

So small countries are not an issue, neither are countries such as china
etc.

I am trying to implement the idea, but cant seem to get my function executed
from the hyper link :(

N

"www.1-script.com" <in************ **********@foo. com> wrote in message
news:S0******** ************@fe 01.news.easynew s.com...
Nicole wrote:

Hi

I need to be able to change the currency and some form fields displayed
on
my website depending on where the visitor is based. I don't need a
fully
functional cart, just a kinda either display '$10' or '£7' sort of
thing!

I think the right way to do that would be using the GeoIP PHP API:

http://www.maxmind.com/app/php

This way you don't have to ask, just give them the custom layout based on
their IP Address. Not without its limitations, but think about
human-induced error factor: it is highly unlikely that you will get an
honest answer from a visitor coming from Russia, India, China or any other
place that online retailers don't like much. They know for the fact that
they will be treated badly and maybe even denied access to the site, so
why bother answering this question honestly? It's so easy to just pick
U.S.A. from the list you've provided.

--
Cheers,
Dmitri
See Site Sig Below
-------------------------------------

--
##-----------------------------------------------##
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
Web and RSS gateway to your favorite newsgroup -
alt.comp.lang.p hp,alt.php,alt.www.webmaster,comp.lang.php - messages and
counting!
##-----------------------------------------------##

Oct 24 '05 #5
>I think the right way to do that would be using the GeoIP PHP API:

http://www.maxmind.com/app/php

This way you don't have to ask, just give them the custom layout based on
their IP Address.
That's great to determine a DEFAULT, but let the user override it.
People do occasionally visit other countries. People could access
the Internet via international long-distance calls. And GeoIP is
far from perfect in determining how an international company allocates
its IP addresses within its own network (information which they
may consider proprietary).
Not without its limitations, but think about
human-induced error factor: it is highly unlikely that you will get an
honest answer from a visitor coming from Russia, India, China or any other
place that online retailers don't like much.
This was supposed to be a way of displaying things in the correct
currency, NOT a security measure to exclude people.
They know for the fact that
they will be treated badly and maybe even denied access to the site, so
why bother answering this question honestly? It's so easy to just pick
U.S.A. from the list you've provided.


And if they like looking at prices in US dollars, that's perfectly fine.
They may not be able to spend their own country's currency outside
that country anyway, and they may end up having to pay in US dollars.

Gordon L. Burditt
Oct 24 '05 #6
Nicole wrote:
I was planning on having a map on my opening screen with hotspots over the
countries.


How do you expect Americans to use that?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Oct 25 '05 #7
Nicole wrote:
I need to be able to change the currency and some form fields displayed on
my website depending on where the visitor is based. I don't need a fully
functional cart, just a kinda either display '$10' or '£7' sort of thing!
Looks wrong. Every currencies have different weightage. Say, for
example 1Euro~55INR while 1USD~45INR.
I was planning on having a map on my opening screen with hotspots over the
countries. <snip>

If supporting many countries, better not use the map at all. For
example, India has different versioned map: Indian version of India,
Pakistan version of India, CIA version of India, etc. So, there are
more chances that it will hurt anyone of them when you prefer one map.
(FYI, M$ had to touch their map of India in Win 95, IIRC).
This seems rather long winded! Is it the right way to do it?


Better, look at other CMS source codes and implementation, esp one
with all these supports.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Oct 25 '05 #8
www.1-script.com <in************ **********@foo. com> wrote:
I think the right way to do that would be using the GeoIP PHP API:

http://www.maxmind.com/app/php

This way you don't have to ask, just give them the custom layout based on
their IP Address. Not without its limitations, but think about
human-induced error factor: it is highly unlikely that you will get an
honest answer from a visitor coming from Russia, India, China or any other
place that online retailers don't like much. They know for the fact that
they will be treated badly and maybe even denied access to the site, so
why bother answering this question honestly? It's so easy to just pick
U.S.A. from the list you've provided.


One thing that really annoys me about Google is that when I use it from
another country, it redirects me to the "local" version and presents itself
in a language that more often than not, I can't understand. Then I have to
go in and set the language preferences for google.com.th or whatever - it
neither picks up on the setting I have for google.com, nor presents a
language option right on the main page.

Making bold yet inflexible guesses about people's preferences is quite often
a bad idea. It would be fine to present a recommended country selection, but
to insist on one based on IP address seems like a poor option.

Not to mention, of course, the unreliability of the practice in the first
place. If you look at the headers of my post you might think I'm in
Washington, DC, but I'm actually in Kuala Lumpur, some 10000 miles away.
There are proxy servers, corporate networks and VPNs, and all sorts of other
confounding factors.

miguel
--
Hit The Road! Photos from 38 countries on 5 continents: http://travel.u.nu
Latest photos: Burma; Hong Kong; Macau; Amsterdam; Grand Canyon; Amman
Oct 25 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2114
by: Ryno Rijnsburger | last post by:
I am busy packaging our product as a standard Setup project in VS.NET that uses a bunch of merge modules (basically, a merge module for every key infrastructure component in our system). Part of the installation needs to "dump" a bunch of files (third party product's project files) to the user's system. These files are transient in nature in that the user may choose
4
2075
by: d.p. | last post by:
Hi all, I'm using MS Access 2003. Bare with me on this description....here's the situation: Imagine insurance, and working out premiums for different insured properties. The rates for calculating premiums are dependant on the country in which the client is in. Therefore, we have a Country table, with its list of rates, a client table and then the property table. Getting this is great, works fine, easy! Problem is, now I need to work out a...
10
2653
by: GeekBoy | last post by:
Okay, I have two identical web servers running Windows 2003 web server. I have an ASP.NET application which runs great on one of them. Dedicated IP address, behind our firewall, etc. Everyone's happy. Now -- how do I take advantage of that second computer to "load-balance" the web site? Will it really give my users a noticable performance increase? How do you accomplish this? I've read many of those MS articles and it's...
2
1905
by: Shapper | last post by:
Hello, I am adding a statistics section to my administration area and I need to get information from my web site visitors when session starts. I know this is done in glabal.asax. My question is: how to get information from the web site visitors? I would like to get some information like: 1. Country;
0
1134
by: ip2location.inc | last post by:
IP2Location has announced the availability of IP2Location .NET Component, that enables application developers to geolocation the Internet visitors by IP Address from their .NET applications. IP2Location .NET Component is fully managed code written for .NET Framework. The component enables you to discover in real-time, where your web visitors are coming from by IP address. You can then dynamically tailor the content of your site based on...
6
2344
by: Paul | last post by:
Hi All, Framework 1.1 listbox control unable to DataBind I've been googling for an answer to this query that appears quite a lot, but none, it seem, answers my problem directly. I am populating a listbox with an array of very simple "Country" objects via a WebService. The Country class contains CountryID,TLDs and Name properties each of which have a getter and setter (I found that properties without
4
34910
true911m
by: true911m | last post by:
Here's a little walkthrough to get py2exe up and running. I'm not an expert, so I can't help much with any problems you might have. This is what worked for me. The result here will be to convert a simple python app into a single .exe file that can be copied and run on any Windows XP machine. It may work on many other Windows platforms, but I haven't tested it. You'll need a working Python installation first, preferably v2.3 or later. ...
2
1666
by: Fred | last post by:
I have a server that will be running as a web server and a database server? To get the best performance is it better to install the database and web server on seperate physical hard drives? or it doesn't matter? I have a total of 8 harddrives, what RAID setup should i choose? Thanks, Fred
0
1101
by: kashok | last post by:
hi all, how to track online visitors ip address and country name through ip address of those who are visiting my web site in asp.net..... Ashok
0
9687
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.