Welcome! Log In Create A New Profile


Coding question/Help

Posted by Omeglewarden 
Coding question/Help
September 20, 2013 08:30AM
I understand peer-block is not really the area to ask, or post this but i have looked at over 90 examples, 30 different websites and asked many people.

What I am trying to do is very simple in idea:

Use JavaSript or Ajax
Get .txt file
Read contents of .txt file for the user's IP address.
Return content line (the data, line it was found on) to the user.

So it would look like this

Return true: You IP was located on our database as OmegleWarden:IP-IP
Return false: Donothing

Can anyone help me?

Re: Coding question/Help
September 23, 2013 09:03PM
What does the txt file look like?
Re: Coding question/Help
October 01, 2013 01:12AM
I have actually solved this in PHP using:

$usip = $_SERVER["REMOTE_ADDR"];
$file = 'blocked.txt';
$searchfor = $usip;

$contents = file_get_contents($file);

$pattern = preg_quote($searchfor, '/');

$pattern = "/^.*$pattern.*\$/m";

if(preg_match_all($pattern, $contents, $matches)){


However the php is not the same server, and it is not able to "Header Location" redirect. It does however display perfectly if your IP is on my database. But the contents are exactly like a list file:


Proxy/VPN/TOR/Unknown 8/27/13:
CBuser 7/3/13:
Chaturbate User 7/3/13:
Malicious IP H-C-D 7/4/13:
Malicious IP H-C-D 7/4/13:
Malicious IP H-C-D 7/4/13:
CB users 7/9/13:
CB user 7/6/13:
Chaturbate User 7/3/13:
Squid USG Blacklist, USG 3/20/13:
cB user 7/9/13:
Malicious IP H-C-D 7/4/13:
Malicious IP H-C-D 7/4/13:

If found, it currently lists "why" you are on the database, and does not redirect to the blocked page, which would do the same - but an option to delist and contact me, etc. (This is where the javascript/ajax method would be extremely handy)
Sorry, only registered users may post in this forum.

Click here to login