Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Save guest reviewer IP address in database

Quote Reply
Save guest reviewer IP address in database
Hello,

When someone submits a review, glinks sends me a nice email notification which includes the ip address (or Remote Host as it is labelled in the email) of the reviewer.

I would like to store this IP address in the Review database in the review record, so I have a permanent record should I need it.

Dos anybody have any ideas as to the easiest way to do this?

Many Thanks,

Rob
Quote Reply
Re: [mrrob] Save guest reviewer IP address in database In reply to
Hi,

The simplest way, would be to do the following:

Database > Reviews > Properties > Add Field

..or the link below, replaced with the correct URL to your admin area =))

http://www.domain.com/cgi-bin/admin/admin.cgi?db=Reviews&do=editor_add_field_form

Add the field:

Column Name: RecordedIP
Column Type: CHAR
Column Size: 20
Not Null No
Default
Form Display: Recorded IP
Form Type: TEXT
Form Size: 10

Then, in review_add.html, find:

Code:
<input type="hidden" name="add_this_review" value="1">

..and add:

Code:
<input type="hidden" name="RecordedIP" value="<%get_their_ip%>">

..then add a new global called get_their_ip , with this code:

Code:
sub { return $ENV{REMOTE_ADDR}; }

Untested, but that should work fine Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Save guest reviewer IP address in database In reply to
Thanks Andy - great solution as always,

My only concern is that a very smart visitor would be able to alter the data in the hidden form field and thereby falsify their IP address. For legal reasons, we need a more robust solution which visitors couldn't tamper with.

I noticed that IP addresses get stored in the ClickTrack table. To store IP addresses in the Reviews table without a hidden field, would a plugin be required?

If so, are you up for the job?

Best Regards,

Rob
Quote Reply
Re: [mrrob] Save guest reviewer IP address in database In reply to
Hi,

Mm.. could be done with a plugin. Shoot me a PM if your interested in a custom job, and I'll have a look into other ways its possible :)

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates