coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: ian ditch on November 11, 2006, 02:01:04 AM

Title: how to record ip address on register?
Post by: ian ditch on November 11, 2006, 02:01:04 AM
Is it possible to add the members ip address to the database when they subscribe?

I have added a cell in cm_users called 'ip_address' and i'm grabbing their  ip adress with
$ip_address = GetHostByName($REMOTE_ADDR); 

I just can seem to place the address into this database cell.

Any help would be appreciated.
Title: Re: how to record ip address on register?
Post by: Nibbler on November 11, 2006, 03:41:48 AM
Query is in register.php

   $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";


Add in your new field there


   $sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, ip_address) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6', '$raw_ip')";