I want to show some text or whatever to only certain regions. I want to run a contest on one of my sites, but only for 1 state at a time. It's a 50 states in 50 days contest. Anyhow... I know you can figure out where someone lives by the IP address, i've seen them on scammy sites and what not. How do I use that for my contest? Say I want to do something for the state of california to start. Is there a way to figure out the IP address range? Or use "ereg" to do this? Thanks in advance. I've looked around but no one seems to know how to do this.
You need a GEO-IP-database and code to use it. Here's both for free: http://software77.net/geoip-software.htm
There are more detailed databases available, though I don't know of any free ones. http://www.maxmind.com/app/region should suffice for your needs
You can do it nationally but not within a country. Its too specific. You would stop most people but there would also be an awful lot who slip through.