Welcome Guest, Not a member yet? Register   Sign In
area.example.com - How to do Subdomains for Location-Based Database Filtering?
#3

[eluser]Nalorin[/eluser]
[quote author="bretticus" date="1281529194"]I do not recommend allowing host header values into your queries. If your location base is large, than I recommend at least keeping a global array with all the possible combination and checking against it or going with a default location (or detect it again.)[/quote]
I won't be placing the location directly into the query - I'll be verifying their location against an array of acceptable cities. If it's valid, then I'll load the information from the db. If not, I'll use geolocation to find the nearest acceptable location then redirect them and load the info from the db.

I was wondering if I should use the $_SERVER['HTTP_HOST'] method to get the subdomain or if there was a better way to get it, but that makes sense.

Thanks for your help Smile


Messages In This Thread
area.example.com - How to do Subdomains for Location-Based Database Filtering? - by El Forum - 08-11-2010, 01:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB