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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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