?
Solved

SQL banning

Posted on 2010-04-02
3
Medium Priority
?
347 Views
Last Modified: 2013-12-12
I have a script, that adds new user to mySQL database. I want to be able to add a button to BAN by IP.

so ill need some code that finds the users Ip when they are online and BAN by IP by days or months. Then give a reason why they are banned.

Need to do this by IP and MAC address.
0
Comment
Question by:966
3 Comments
 
LVL 5

Accepted Solution

by:
miahi earned 2000 total points
ID: 29461570
In PHP you can get the user's IP using $_SERVER['REMOTE_ADDR'], then you do a select in the DB for that IP and show them the message if they are found.

You can't use the MAC address, because it's not something you can find in the HTTP request. There are some workarounds for this if all your users are in the same LAN as the server.

You can find many examples of this kind of access control, like this one here: http://forum.codecall.net/php-tutorials/2232-ban-ips-mysql-database.html
0
 

Author Comment

by:966
ID: 29514606
i make delphi app to get mac, tnx
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Blockchain technology enhances society similar to the Internet. Its effects are broad, disruptive, and will boost global productivity.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question