Jump to content

Search the Community

Showing results for tags 'ip'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 7 results

  1. 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?
  2. 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
  3. 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("", "", "", "", "", "", "", "", "", "", "", "", ""); 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
  4. 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.
  5. 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
  6. 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?
  7. 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
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.