Jump to content

Change string based on location


iheartpie

Recommended Posts

Hello all,

 

I'm after a neat script that will change a piece of copy (in strong form) dependant on the IP location of the user.

 

i.e. if the user is in the US (according to their IP) then the string might read 'blue', whereas if they're in the UK (according to their IP) then the string may read 'red'.

 

I'm only assuming that PHP will be the most appropriate for this task, correct me if I'm wrong - I'm also assuming that it will take the form of an IF statement or an array of some kind - but PHP really isn't my thing unfortunately.

 

Any help is much appreciated,

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/238874-change-string-based-on-location/
Share on other sites

I don't need the script to be written for me, I'd be just as happy with a point in the right direction - a tut, or even a name for the function.

 

I don't expect anyone to work for free, but lets be honest, this is a help section - most people call that consultancy and charge a bomb for it, so lets not be pedantic.

 

Thanks all the same.

This forum is for helping people that have tried writing the code on their own and simply cannot figure a part of it out, not for people looking for "freebees". Just to clarify that. here is an API that may be able to help you http://ipinfodb.com/ip_location_api.php

As stated, I'm not after any 'freebies' - I'm after an instructional approach as to how to achieve something - that's called help.

 

I'll go find a more helpful community, cheers anyway guys - glad I don't work with PHP, bunch of miserable bastards.

and i helped you by pointing you in the right direction...however, peace out girl scout

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.