Tags: ip, locale, php, script, source code, ตรวจสอบ, ประเทศ, โปรแกรม
ปัญหานี้เจอมาหลายทีล่ะ หาคำตอบอยู่หลายหนเหมือนกัน ไหนๆ ก็ไหนๆ วันนี้อเมซอน update ข้ามวันอีกแล้ว ระหว่างนั่งรอด้วยความเซ็ง เลยเอาเวลานั่งหง่าวไปหาข้อมูลในเนต
แล้วก็ได้เรื่องซ๊าด้วย
มีโปรแกรมเชค ip แล้วครับ มีคนใจดีเขียนไว้ให้ใช้อีกเช่นเคย ปรับนิดๆ หน่อยๆ ก็ใช้ได้แล้ว
เดิมทีผมเปิดร้าน AOM ไว้ ขายของให้คนในฝั่งอเมริกา แล้วก็โปรโมทๆ ก็มี traffic เข้ามาเรื่อยๆ แต่ช่วงหลังๆ นี่ไม่รู้เป็นไง traffic จาก อังกฤษแซงขึ้นนำเฉยเลย (ดูสถิติจาก hosting) มันก็เลยเกิดปัญหาว่าร้านที่ขายคนแต่ละประเทศอเมซอนให้รหัสสินค้าและเว็บอเมซอนคนละเว็บเลย พอคนอังกฤษเข้าร้านอเมริกามันเลยไม่มีออเดอร์ครับ
การแก้ไขปัญหาคือ เชค ip ถ้ามาจาก UK ต้อง forward ไปร้านที่เตรียมไว้อีกร้านนึง ปัญหาคือจะรู้ได้ไง ip ไหนประเทศไหน วันนี้เลยลองค้นๆ กับ GG ดู ก็เลยรู้ว่าเขาต้องมีฐานข้อมูลเก็บช่วง ip ของแต่ละประเทศไว้ ถ้า ip ตกช่วงประเทศไหนก็ประเทศนั้นแหละ
แล้วก็โชคดีครับมีคนเตรียมฐานข้อมูลและ script ไว้ให้ใช้แล้ว ลองดูแล้วใช้ได้ดีเลยทีเดียว ลองดูนะครับ ที่
http://www.prodevtips.com/2008/03/18/ip-to-country/
cvs เก็บข้อมูลช่วง ip
http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip
ถ้าใช้แล้วมีปัญหาไม่เข้าใจ ก็โพสถามได้นะครับ ถ้าช่วยอธิบายได้ก็จะช่วย ถ้าช่วยไม่ได้ก็จะช่วยครับ
อ้อ ลืมบอก อันนี้เป็น php นะครับ ใช้ร่วมกับ mysql
December 17th, 2009 at 10:28
งงวิธีใช้ ครับ
ถ้าไม่รบกวนเกินไปขอ แบบเป็นขั้นตอนการใช้ ที่ล่ะขั้นได้ไหมครับ
ขอบคุณมากครับ
December 17th, 2009 at 13:29
คือ ผมโมโปรแกรมเขานิดนึง
1. download
http://rich.meemarket.com/download/locale_check.zip
2. unzip และ แก้ไข user/pass/db name ในไฟล์ import.php ,locale_check.php ให้เป็นของเรา
3. แก้ไข บรรทัดที่ 46 ของ locale_check.php
ตรงบรรทัด header(”location: http://www.xxx.com“);
ว่าจะ forward ไปเว็บไหน หรือ หน้าไหน
4.upload ทั้ง 3 file ไปไว้ยัง web folder ของเราบนเซอร์เวอร์
5. run file import.php สำหรับสร้างตารางฐานข้อมูล และนำเข้าข้อมูลจาก cvs file
6. แทรกคำสั่ง
include(”locale_check.php”); ใน index.php หรือ shop.php ของ aom
เสร็จแล้วครับ
ขอให้รวยๆ กันทุกคนน๊า
December 19th, 2009 at 16:46
local_check.php ผมแก้บรรทัดที่ 43 นิดนึงครับ เพิ่มเงื่อนไขใน if
เพราะรหัสประเทศอังกฤษน่าจเป็น GB เลยใส่ไปทั้ง 2 รหัสเลย ถ้าเป็น GB หรือ GBR จะ ส่งไปอีกร้าน
แบบนี้ครับ
if(check_country(’GB’, $_SERVER['REMOTE_ADDR']) || check_country(’GBR’, $_SERVER['REMOTE_ADDR'])) {
February 12th, 2010 at 14:28
Im depressed…
Have a nice day
Worker
March 21st, 2010 at 09:35
Cool post, but is your amazon account suspended and you can’t make any new accounts? Do your accounts keep on getting linked together and you don’t know what to do? Purchase the Amazon Stealth eBook and learn how to become completely anonymous and start selling on amazon again with no problems! Check them out today!
March 26th, 2010 at 11:20
Cool post, but is your Google Adsense or Adwords account suspended and you can’t make any new accounts? Do your accounts keep on getting linked together and you don’t know what to do? Purchase the Google Stealth eBook and learn how to become completely anonymous and get on Google again with no problems! Check them out today!
April 15th, 2010 at 09:03
I’m a blogger myself and I found your post to be very interesting and unique. Good job on the post, and I’ve just became subscribed to your blog. Hope you do the same for me.
Good luck on your blog, and feel free to visit and comment on my blog as well!
- Entrepreneur Key – Your key to success
May 19th, 2010 at 03:49
Different people in all countries receive the http://www.lowest-rate-loans.com from various banks, just because that is fast and easy.
June 16th, 2010 at 17:09
This is some really good information. I’m shocked by the quality of your site
July 23rd, 2010 at 18:01
Great to find out you back. And again through an interesting post.
August 19th, 2010 at 14:06
Keep up the amazing work!! I love how you wrote this and I also like the colors here on this site. did you create this yourself or did you outsource it to a coder??
August 27th, 2010 at 18:59
Your blog article is very intersting and fanstic,at the Exact same time the blog theme is unique and Appropriate,great Duty.To your
August 29th, 2010 at 20:09
The perfect!These Write-ups written As Nicely great,they Abundant contents and Info accurately.they are Aid to me.I expect to see
September 1st, 2010 at 00:59
Hi Webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!Keep ‘em coming… you all do such a great job at such Concepts… can’t tell you how much I, for one appreciate all you do!
October 4th, 2010 at 14:44
I am sure you have spent a lot of time to provide this quality article to us. I do not know how to thank you.
October 16th, 2010 at 22:23
In searching for sites related to web hosting and specifically comparison hosting linux plan web, your site came up.
October 25th, 2010 at 18:41
Hi Webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!Keep ‘em coming… you all do such a great job at such Concepts… can’t tell you how much I, for one appreciate all you do!
October 25th, 2010 at 19:01
I must say that overall I am very taken with this site. It is apparent that you know you subject matter and you are passionate about it. I wish I had got your ability to write. I have bookmarked your site and look forward to more updates.
October 28th, 2010 at 14:10
Interesting subject. The marajuana users in my group like to talk about this.
October 29th, 2010 at 03:29
Completely I share your opinion. In it something is also to me this idea is pleasant, I completely with you agree.
October 29th, 2010 at 11:22
Hi I found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later
October 30th, 2010 at 05:14
Thank you for an additional fantastic blog.Where else could I get this type of information composed in this kind of an incite total way? I’ve a project that I am just now doing work on, and i’m sure this will aid me a lot..and I’ve been looking for this kind of material since from couple of days….Thanks!!!!!
October 30th, 2010 at 10:47
Hey, something is wrong with your site in Opera, you should check into it.
October 31st, 2010 at 21:03
Good info in your posting, I saw a report on television last week about this same stuff and since I am getting married in five weeks and the timing couldn’t have been better! thanks for the post!
November 1st, 2010 at 02:45
You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material.
November 1st, 2010 at 16:22
Could you write another article about this topic simply because this article was a bit tricky to understand?
November 1st, 2010 at 17:58
@Jo – You refer to an fascinating feature there. Not everybody has the ability to guarantee these effects are undertaken in the correct way and handy tips such as those you have provided will help support the problems to a much larger extent than it is currently.
November 1st, 2010 at 19:49
Great information!!! Thanks a bunch for sharing!
November 1st, 2010 at 19:59
I recently came across your web site and have been reading along. I thought I would leave my very first comment. Nice blog. I will keep visiting this website very frequently.
November 2nd, 2010 at 09:06
Thanks so much for this great article; this is the kind of thing that continues me though out the day. I’ve been searching around for your site after I heard about them from a buddy and was thrilled when I was able to find it after searching for some time. Being a avid blogger, I’m pleased to see others taking initiative and contributing to the community. I just wanted to comment to show my appreciation for your work as it’s very encouraging, and many writers do not get the credit they deserve. I am sure I’ll be back and will send some of my friends.
November 2nd, 2010 at 15:47
I’d just like to let you know how much I learn from your wisdom Bookmarked you.Hope to be back fast for some more good articles
November 3rd, 2010 at 22:27
I’ve the same problem sometimes, but I usually just force myself via it and revise later. Great luck!
November 7th, 2010 at 01:53
It’s really great post, nice blog..I am really looking forward to your next post. very good post informative content, Thanks for sharing!
November 7th, 2010 at 03:27
That is some inspirational stuff. Never knew that opinions could be this varied. Thanks for all the enthusiasm to offer such helpful information here.
December 17th, 2010 at 23:12
ценно , да весь интернет об этом говорит!
December 24th, 2010 at 21:34
Thank you for this news! do you might if i share this?
January 13th, 2011 at 14:55
Excellent beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea
January 15th, 2011 at 23:33
I think this is among the most significant info for me. And i am glad reading your article. But want to remark on some general things, The site style is perfect, the articles is really great : D. Good job, cheers