Re: [PHP] ip-to-country

2009-10-18 Thread George Langley
On 18-Oct-09, at 1:03 PM, SED wrote: How can I access an index for IP to a country (or a more detailed location)? has both free and various paid services. George -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-18 Thread Dotan Cohen
> test if you have a db connection in the function, if not, skip MRES and > other mysql_ functions? > I thought that one could not test if a database connection is established or not, this is the most relevant thing that I found while googling that: http://bugs.php.net/bug.php?id=29645 > In my op

Re: [PHP] ip-to-country

2009-10-18 Thread Per Jessen
SED wrote: > Hi, > > How can I access an index for IP to a country (or a more detailed > location)? I have not yet found a function for that in PHP nor a free > to use website that offers a remote search. > > Perhaps, there is another solution - any ideas? DNS lookup - see http://countries.nerd

Re: [PHP] ip-to-country

2009-10-18 Thread Michael Shadle
http://pecl.php.net/package/geoip however i tried a few IPs once and it was "unknowns" On Sun, Oct 18, 2009 at 12:03 PM, SED wrote: > Hi, > > How can I access an index for IP to a country (or a more detailed location)? > I have not yet found a function for that in PHP nor a free to use websit

[PHP] ip-to-country

2009-10-18 Thread SED
Hi, How can I access an index for IP to a country (or a more detailed location)? I have not yet found a function for that in PHP nor a free to use website that offers a remote search. Perhaps, there is another solution - any ideas? Regards, Summi -- PHP General Mailing List (http://www.php.

Re: [PHP] Using setters/getters with array of objects

2009-10-18 Thread Tommy Pham
- Original Message > From: mbneto > To: php-general@lists.php.net > Sent: Sun, October 18, 2009 8:31:53 AM > Subject: [PHP] Using setters/getters with array of objects > > Hi, > > I have two classes User and Email where one User can have many Emails so > I've done like this > > class E

Re: [PHP] Using setters/getters with array of objects

2009-10-18 Thread Andy Shellam (Mailing Lists)
Hi, $u->emails[] = $e; I would hazard a guess because $u->emails isn't a concrete object (whereas $u->_emails is, but is private.) It's sort of a virtual reference - PHP has no way of knowing that $u->emails actually translates into _emails which is an array, if you see what I mean (

[PHP] Using setters/getters with array of objects

2009-10-18 Thread mbneto
Hi, I have two classes User and Email where one User can have many Emails so I've done like this class Email { protected $_email; public function __get($name) { $property = '_' . $name; return $this->$property; } public function __set($name, $value) {

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-18 Thread Kim Madsen
Dotan Cohen wrote on 2009-10-18 10:52: I assumed the reason you wanted to do escape the string so that you could perform DB operations. Yes, that is my intention. However, the function is found in an include file of functions used in many different scripts, each of which connect to a different

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-18 Thread Dotan Cohen
> I assumed the reason you wanted to do escape the string so that you could > perform DB operations. Yes, that is my intention. However, the function is found in an include file of functions used in many different scripts, each of which connect to a different database or may not connect to a data

Re: [PHP] Sanitizing potential MySQL strings with no database connection

2009-10-18 Thread Jim Lucas
Dotan Cohen wrote: How can I configure mysql_real_escape_string() to _not_ need a database connection in order to do it's work on a string. I understand that the function wants a database connection to determine which charset / encoding is in use, but in my case it will always be UTF-8. I have a