Search the Community
Showing results for tags 'ip'.
-
I'm trying to get an id for a row in a lookup table based on an ip address. All ip's are stored as the result inet_aton(ip) in fields that are varbinary(16). The lookup table has ip ranges (start_ip and end_ip) and countries associated with the range. 1219006512 is the inet_aton value of a user's ip address. When I run the following query in phpmyadmin, I'm getting multiple rows. I get multiple rows with a different result set if I run the query in mysql in the terminal. Query follows: SELECT * FROM lookup WHERE ('1219006512' >= start_ip and '1219006512'<= end_ip); What am I doing wrong?
-
Hello, I got a web app on a local web server. I got devices connected to the same network through Wi-Fi. each device make a login first so I can store the timestamp of the login in mysql table. devices are doing either - log out or - simply get out of the Wi-Fi zone without log out. in the 2nd case I still want to get the time it happens. What do you suggest to get a more or less accurate time of logout? Thanks in advance for help Chris
-
Hi, i webmaster multi sites and at the moment run php code to block unwanted ip addresses because of bad submittings. I am running this code at the moment <?php $deny = array("159.224.160.42", "91.200.14.59", "146.0.74.205", "91.200.14.59", "5.39.219.26", "91.232.96.8", "216.151.137.34", "216.151.137.35", "216.151.137.36", "213.238.175.4", "91.232.96.2", "188.92.75.82", "91.207.7.141"); if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) { header("location: http://www.cnn.com/"); exit(); } ?> The problem is that each time i want to block a person i have to add their ip address to all the index.php. I would like to run this code but get the ip addresses from a single site, my main site. Please help me with what the file would look like on my site, how i would read it in so that the array would look like the above. Thanks Warren
-
Easiest way to explain it would be to look at Groupon, LivingSocial and other deal sites. They show deals/records based on a user's city location. That's what I want to achieve. As far as I know, there are 3 things involved. 1. Getting a database with list of countries/regions/cities. 2. Country based dynamic dropdown option when posting a record on a website. 3. Showing records based on user's ip address. I am guessing to do this, one must have latitude and longitude listed in the countries database. I'm in the process of doing that. If you have any tips or information you would like to share, that would be great.
-
hi i'm running website with many vistors at times i get people who abuse my site i would like to know if there is way to block these users via cookies or php , for example my site have to take action against ips that used to click on link more than 5 times tnx
-
I am running a PHP-based Browsergame. My actual banning system gets the ip using this function which I found to be very good. function get_real_ip() { $client_ip = (isset($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : ''; $x_forwarded_for = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; $remote_addr = (isset($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : ''; if (!empty($client_ip)) { $ip_expl = explode('.',$client_ip); $referer = explode('.',$remote_addr); if($referer[0] != $ip_expl[0]) { $ip=array_reverse($ip_expl); $return=implode('.',$ip); } else { $return = $client_ip; } } else if (!empty($x_forwarded_for)) { if(strstr($x_forwarded_for,',')) { $ip_expl = explode(',',$x_forwarded_for); $return = end($ip_expl); } else { $return = $x_forwarded_for; } } else { $return = $remote_addr; } unset ($client_ip, $x_forwarded_for, $remote_addr, $ip_expl); return $return; } Now the problem is, that I still can't get the correct ip, a user still keeps on loggin on. So how does he do that and how to prevent him to register again and again?
-
Hi guys. I'm modifying my CometChat to display guest user IP addresses to moderators. I've successfully got ip addresses of guests to save in the database in ip2long format. Now I need to retrieve and print an IP address of a user to a moderator when they click the guest's username The code I need to print the IP address is here: if($owner == 1 || in_array($userid,$moderatorUserIDs)) { $options="<input type=button value='".$chatrooms_language[40]."' onclick=javascript:".$caller."kickUser($uid,0);$close class='invitebutton'> <input type=button value='".$chatrooms_language[41]."' onclick=javascript:".$caller."banUser($uid,0);$close class='invitebutton'>".$options; This shows a KICK & BAN button. Either above or below them I need it to say IP: - the guest's IP- The ip2long IP address is stored in cometchat_guests in the column 'ip' I need to put: SELECT INET_NTOA(ip) FROM 'cometchat_guests' WHERE 1 But I'm not sure what goes after WHERE... WHERE what? WHERE 1 = $uid Or WHERE $uid = 1 echo $ip Would be very grateful and appreciate any help here, thank you so much in advance I'm getting a migraine here