how to record ip address on register? how to record ip address on register?
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

how to record ip address on register?

Started by ian ditch, November 11, 2006, 02:01:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ian ditch

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.

Nibbler

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')";