Coding question/Help
September 20, 2013 03: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?

~OmegleWarden
Re: Coding question/Help
September 23, 2013 04:03PM
avatar
What does the txt file look like?
Re: Coding question/Help
September 30, 2013 08:12PM
I have actually solved this in PHP using:


<?php
$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:

example:

Proxy/VPN/TOR/Unknown 8/27/13:64.62.246.0-64.62.247.255
SBL-MAL,searchexpander.com:64.64.8.220-64.64.8.220
SBL-MAL,cescon.ca:64.64.11.6-64.64.11.6
SBL-MAL,scoobidoo.com:64.64.12.56-64.64.12.56
CBuser 7/3/13:64.64.166.136-64.64.166.136
Chaturbate User 7/3/13:64.64.170.186-64.64.170.186
SBL-MAL,pacc.info:64.64.214.138-64.64.214.138
Malicious IP H-C-D 7/4/13:64.65.80.182-64.65.80.182
Malicious IP H-C-D 7/4/13:64.66.68.249-64.66.68.249
Malicious IP H-C-D 7/4/13:64.66.85.115-64.66.85.115
CB users 7/9/13:64.66.124.155-64.66.124.155
CB user 7/6/13:64.66.230.10-64.66.230.10
oW.v:64.66.232.58-64.66.232.58
Chaturbate User 7/3/13:64.66.232.230-64.66.232.230
Squid USG Blacklist, USG 3/20/13:64.68.64.0-64.68.95.255
cB user 7/9/13:64.68.229.2-64.68.229.2
Malicious IP H-C-D 7/4/13:64.69.34.134-64.69.34.134
Malicious IP H-C-D 7/4/13:64.69.34.150-64.69.34.150

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