PDA

View Full Version : i.p. tracking



cheatpark
January 18th, 2002, 17:49
Can someone help me find a php script that tracks i.p. addresses and only lets certain i.p's access a php page. I need this to make only me able to access phpmyadmin on my site. Also could someone show me where I should put it in the code or give me instructions (something like that). Thanks in advance.

The Rock
January 18th, 2002, 18:03
I think you can put some code in your .htaccess file to block certain ip addresses from viewing the files in the dir.

niv
January 18th, 2002, 18:03
$REMOTE_ADDR contains the IP address. Figure out the rest. ;)

Cyber
January 18th, 2002, 18:06
heh, i was just talking to him, i did it :biggrin2: yay!

cheatpark
January 18th, 2002, 19:42
Yeah, I'm using cyber's special php code. Here's the code just incase anyone was interested:



<?php
if ($REMOTE_ADDR=="insert your i.p. address here") {
// OPEN THE PHPMYADMIN SECTION
} else {
die ("Sorry! This is not a public area of cheatpark.net.");
}
?>

megapuzik
January 18th, 2002, 22:59
But you can use phpMYadmin build in psw protection, and dont use IP, you should send psw headers, and use php global psw vars...

cheatpark
January 20th, 2002, 17:15
How do I do that? Or is there I way I can tell the script to look for a file on my computer with a password?

megapuzik
January 21st, 2002, 00:23
Im not sure, but phpmyadmin send you the global password+username variables...and you dont need to login every-time...

just for test, request one of your good friend, and see if he can login to phpmyadmin...

cheatpark
January 21st, 2002, 13:26
So how can I change this username and password?

megapuzik
January 22nd, 2002, 06:33
Originally posted by cheatpark
So how can I change this username and password?
I really dont know.....but you can look here (http://sourceforge.net/projects/phpmyadmin/)