Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: how to record ip address on register?  (Read 2583 times)

0 Members and 1 Guest are viewing this topic.

ian ditch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 49
how to record ip address on register?
« 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
Code: [Select]
$ip_address = GetHostByName($REMOTE_ADDR); 
I just can seem to place the address into this database cell.

Any help would be appreciated.
Logged

Nibbler

  • Guest
Re: how to record ip address on register?
« Reply #1 on: November 11, 2006, 03:41:48 am »

Query is in register.php

Code: [Select]
   $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

Code: [Select]
   $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')";
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.