95Views7Replies

Author Options:

Need help with web script? Answered

I know a little about scripting web pages, but I'm mostly a hardware guy.  I need to figure out how to make certain text on a web page change based on where the client's location is.  (For instance, I need to say "serving (client town here) and the surrounding area since......." and I also need the phone number to change.  So far the best option I have come up with is creating a different web page for each town.  I know this script is possible, but I just don't know how to make it.  If anybody out there knows how to script this, I would help me a lot.  Thanks!

Discussions

0
None
canucksgirl

Best Answer 7 years ago

Yes, this task is possible, but how do you intend on getting the clients location? Are they users that sign up to your site, therefor their location is in a DB? or are you trying to achieve this based on their IP? Also, what scripting language(s) are you comfortable working with? If you have a DB server, what language are you using to access the data? There's more than one way to do this... just need some clarification.

0
None
thegeekecanucksgirl

Answer 7 years ago

I hope to get their location based on the ip address (I know this is only a rough estimate). They will not be entering data in a DB, and I do not have a DB on the server. It's basically just displaying contact info, but that info will change based on their location. I can do a little with HTML and PHP, but the rest of what I want to do with the site besides this script is pretty simple, so I could learn the basics of any other language pretty quick. Thanks for the help! :)

0
None
canucksgirlthegeeke

Answer 7 years ago

The IP can give you the users specific location, HOWEVER, if they are using a Proxy Server, you won't get the correct data.

The process can be done, but requires some work. To get you going in the right direction, (which will also give you additional support resources) I recommend you do the following;

Go to Freegeoip.net - They provide free database access for IP lookups. You'll need this.

Then go to StackOverflow. I would recommend you search the forum for support in PHP, or any other language that you wish to code in.

The site is a great resource for information and help. Just keep in mind their rules. Search your topic before posting for help and include any code you already have. The more info you give, the more you get. Then continue utilizing their resources as you go along - its your best bet at this point, as you are likely to have additional questions as you code.

0
None
thegeekecanucksgirl

Answer 7 years ago

Thanks so much for your help! I'll be starting on the design tomorrow! :)

0
None
Jayefuu

7 years ago

It's fairly simple with PHP. Using their IP address will only give you a rough idea of where they are though. Or are you expecting the user to input their town?

James

0
None
thegeekeJayefuu

Answer 7 years ago

I realize it will only be a rough estimation, and they will not be entering info into a DB.

Thanks for your help! :)