Ip Nd Browser Detection

Started on the old forum in September 2007 · view the original in the archive · old links redirect here

13 replies · 1,252 views · started 19 years ago · 1 min read

4 participants
Regz #1

Here is the code for gettin ip nd browser used in chat script m using :-

case 'agent';
if($login['moder']>=3) {
$q = @mysql_query("select * from `".$px.$utable."` where id='$whoid';");
$dbuser = @mysql_fetch_array($q);
$q = @mysql_query("select * from `".$px.$utable."` where id='$whoid';");
$dbuser = @mysql_fetch_array($q);
print "[b]Ip:[/b]
".$dbuser['ip']."
";
print "[b]Remote Ip:[/b]
".$dbuser['rip']."
";
print "[b]Headers:[/b]
".$dbuser['url']."
";
print "[b]Browser:[/b]
".$dbuser['soft']."
"; }
else print $lang['access_denied'];

break;

This shows ip nd browser of login registration time tht is stored in database i want to see current ip of users i tryed many things nothing works pls help thnx .

Regz #3

Its Cz script only for chat

Regz #5

Bro Ip i see is wht user had at the registration time it dont change even if user has changed his mobile nd ip the same ip shows wht is saved in database at the registration time ....

blackhowk Senior · 411 posts #6

i know what you want, i know what to do, but i dont know ...the script and your database LOLZ

Regz #7

ok bro here is database nd script is chatzone one shud i uplooad it here ? sql tables

-- Table structure for table `chat_ignor`
-- 

CREATE TABLE `chat_ignor` (
  `id` int(11) NOT NULL auto_increment,
  `loginid` int(11) NOT NULL default '0',
  `user` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_ignor`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_letters`
-- 

CREATE TABLE `chat_letters` (
  `id` int(11) NOT NULL auto_increment,
  `from_user` text NOT NULL,
  `to_user` text NOT NULL,
  `subject` text,
  `letter` text NOT NULL,
  `time` text NOT NULL,
  `new` int(11) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_letters`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_meets`
-- 

CREATE TABLE `chat_meets` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `title` text NOT NULL,
  `content` text NOT NULL,
  `organizatory` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_meets`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_messages`
-- 

CREATE TABLE `chat_messages` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `pr_from` text,
  `pr_to` text,
  `time` text NOT NULL,
  `room` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_messages`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_ques`
-- 

CREATE TABLE `chat_ques` (
  `id` int(11) NOT NULL auto_increment,
  `vopros` text NOT NULL,
  `otvet` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_ques`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_settings`
-- 

CREATE TABLE `chat_settings` (
  `id` int(11) NOT NULL auto_increment,
  `mod` text,
  `var` text,
  `val1` text,
  `val2` text,
  `val3` int(11) default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2;

-- 
-- Dumping data for table `chat_settings`
-- 

INSERT INTO `chat_settings` VALUES (1, 'room', 'room1', 'Main', 'Main', 0);

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_users`
-- 

CREATE TABLE `chat_users` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `pass` text NOT NULL,
  `name` text NOT NULL,
  `sex` text NOT NULL,
  `bday` int(11) default '0',
  `bmonth` int(11) default '0',
  `byear` int(11) default '0',
  `photo` text,
  `live` text,
  `mobile` text,
  `operator` text,
  `email` text,
  `wapsite` text,
  `website` text,
  `icq` int(11) default '0',
  `about` text,
  `status` text,
  `posts` int(11) NOT NULL default '0',
  `vposts` int(11) NOT NULL default '0',
  `nmsgs` int(11) default '0',
  `tupdate` int(11) default '0',
  `fsize` text,
  `ban` text,
  `breason` text,
  `btime` text,
  `room` text,
  `moder` int(11) default '0',
  `admin` int(11) default '0',
  `rtime` int(11) NOT NULL default '0',
  `ltime` int(11) NOT NULL default '0',
  `ip` text,
  `soft` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_users`
--

-- --------------------------------------------------------

-- 
-- Table structure for table `chat_vict`
-- 

CREATE TABLE `chat_vict` (
  `id` int(11) NOT NULL auto_increment,
  `login` text NOT NULL,
  `msg` text NOT NULL,
  `pr_from` text,
  `pr_to` text,
  `vopros` text,
  `answered` text,
  `time` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chat_vict`
-- 

-- --------------------------------------------------------

-- 
-- Table structure for table `chatlog`
-- 

CREATE TABLE `chatlog` (
  `id` int(10) NOT NULL auto_increment,
  `date` varchar(99) NOT NULL default '',
  `text` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;

-- 
-- Dumping data for table `chatlog`
--
Regz #8

i have found out the code for gettin it done pls can u ppls modify this code so it updates old ip nd soft wid new one correctly cos this dont seem to be working pls chk :-

if($login) {
    if(!$login['ip']) { @mysql_query("update `".$px.$utable."` set `ip`='".getenv(REMOTE_ADDR)."' where `id`='".$id."';"); }
    if(!$login['soft']) { @mysql_query("update `".$px.$utable."` set `soft`='".getenv(HTTP_USER_AGENT)."' where `id`='".$id."';"); }
WhiteWarrior Principal · 1,419 posts #9

that code should auto update its self mate

Regz #10

Tht i kno but its not doin so is it probably cos m on free server ? or if u have any effective coding for this pls give me

GumSlone Administrator Principal · 1,690 posts #11

Here is a code, replace the code you posted above with this one.

if($login) @mysql_query("update `".$px.$utable."` set `ip`='".getenv(REMOTE_ADDR)."', `soft`='".getenv(HTTP_USER_AGENT)."' where `id`='".$id."';");

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Regz #14

hero jst post the code wht u have nd tht code isnt of user.php but enter.php wht Gumslone gave nd wht i posted is in old script .

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close