Re: is there a function/variable with remote host addr?
| От | will trillich | 
|---|---|
| Тема | Re: is there a function/variable with remote host addr? | 
| Дата | |
| Msg-id | 20010904214300.D8460@serensoft.com обсуждение исходный текст | 
| Ответ на | is there a function/variable with remote host addr? (David Ford <david@blue-labs.org>) | 
| Список | pgsql-general | 
On Tue, Sep 04, 2001 at 01:41:52AM -0400, David Ford wrote:
> As the subject says, is there a function or variable in pg I can use as
> a default insert/update value on a column that represents the IP or
> hostname of the current session's remote client?
presuming you're using apache/mod_perl, you can get it from
    $r->connection->remote_ip
and then slip it into your sql however you like. i use
    $sth = $dbh->prepare("insert into hits (client_ip) values ( ? )");
    $sth->execute( $r->connection->remote_ip );
--
Hey, let's change the whole justice system. Everybody gets to
kill one person -- if you do two, you go to jail. That should
cut down on the abrasive personalities, don't you think?
will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!
		
	В списке pgsql-general по дате отправления: