Jump to content

[SOLVED] How to make a ban form


Jamrams

Recommended Posts

Hey everyone,

 

So recently I've been trying to make a form on the staff login bit on my website where it automatically adds the IP and Reason you type in to a database, and also the person who is logged in.

 

Then, (in the header of the file) it checks if the IP matches one of ones in the database, and if it does it sends them to banned.php

On banned.php, it checks which IP it is, then it shows whatever reason was entered and who banned them.

 

This is the kinda thing I tried using...

 

if($_SERVER["REMOTE_ADDR"] == "x.x.x.x") {

header('location:banned.php');

die();

}

 

but I couldn't figure out how to do much else (it works if you manually enter in an IP address).

 

Any help on the matter would be greatly appreciated,

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/125655-solved-how-to-make-a-ban-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.