11-Oct-2012, 01:53 PM
Insert your clients unique id in the ip_address field, instead of a server ip address within a secure logged in website you already created.
Also cross reference to thread
http://www.commentics.org/forum/showthre...83#pid3583
(Problem where everybody on the network share the same ip_address)
On your first php landing page after member has logged in.
Create the server variable MM_Username to create a recordset (I called mine rslogindetails) attaching to all the table details of your logged in member.
My table with all members details is called client. My members username (MM_Username) is attach to the field 'clientemail' within the client table.
So I basically just join the two in the record set, where my logged in username is also my members email address (clientemail)
Also cross reference to thread
http://www.commentics.org/forum/showthre...83#pid3583
(Problem where everybody on the network share the same ip_address)
On your first php landing page after member has logged in.
Create the server variable MM_Username to create a recordset (I called mine rslogindetails) attaching to all the table details of your logged in member.
My table with all members details is called client. My members username (MM_Username) is attach to the field 'clientemail' within the client table.
So I basically just join the two in the record set, where my logged in username is also my members email address (clientemail)
PHP Code:
<?php $colname_rslogindetails = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rslogindetails = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}
mysql_select_db($database_yourdatabasename, $yourdatabasename);
$query_rslogindetails = sprintf("SELECT * FROM client WHERE clientemail = %s", GetSQLValueString($colname_rslogindetails, "text"));
$rslogindetails = mysql_query($query_rslogindetails, $yourdatabasename) or die(mysql_error());
$row_rslogindetails = mysql_fetch_assoc($rslogindetails);
$totalRows_rslogindetails = mysql_num_rows($rslogindetails);
?>
After creating above recordset, my whole website from here basically works on the client unique id 'clientid' field (a Auto Incriment number created when signing up)
I want THIS NUMBER to become my unique ip_address in commentics, comments table.
So still within my landing page I am going to create a server variable, and attach this to the clientid (within my created recordset rslogindetails).
I called this variable 'clientnumber' and = it to the field containing the unique id number in my table called 'clientid'
PHP Code:
<?php
// this starts the session
if (!isset($_SESSION)) {
session_start();
}
// this sets variables in the session
$_SESSION['clientnumber']=$row_rslogindetails['clientid'];
?>