I Need A Very Urgent Help And Need It Badly

Started on the old forum in October 2008 · view the original in the archive · old links redirect here

41 replies · 1,826 views · started 18 years ago · 1 min read

TL;DR · summary of 41 replies
  • - The code approach to ban a user with their nick and IP/Browser combo is not provided in the thread as it concluded that adding such functionality would require custom coding work which was deemed too time-consuming by...
  • - A simple file named blocked.php was suggested for banning users based on browser strings, but no full script or code examples were given.
  • - The use of a single banned.txt file to store banned details was proposed as an alternative method, though it did not include how to save data in combo format like nokia 6630 | 123.456.789.65.
  • - No solution or code for banning users based on nick and IP/Browser combination was provided in the thread.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

6 participants
bijaybd Developer · 178 posts #1

can anybody please full fill one more request of mine like in Mobile Chat 2.0.2 WML1.2EN (multi room) chat there is ban kill but there is no brower banning system or ip banning system with time so that if a user get that ban can not register a new account or can not login by his nick for that perticular time so that flooder can not fllood by registering a lot ids like logogo has that system if someone get banned for 1 hour that user can not login for 1 hour and also can not register another account also htportal has this system i think may be its called browser banning if anybody can help me please post it it will be really greatfull for me please . just the script that i will able to ban a person and that perticular person can not enter my chat with in 1 or 2 or 3 days please help me on that case i am in a big trouble of floooding.

darkdesire Senior · 250 posts #2

create a file say blocked.php and add the following

<?php if(strstr($_SERVER['HTTP_USER_AGENT'], "Opera/9.50 (Windows NT 6.0; U; en)")) { die("Following recent high abuse of the system, your access has been blocked."); } ?>

obviously replacing the Opera/9.50 (Windows NT 6.0; U; en) with the device you want blocked, now just add an include on each page you want them blocked from, something like

    include("blocked.php");

usually index.php and your register and login pages will suffice,

:p:p:p

chris Junior · 39 posts #3

Check the topic here called simple ip ban for mobile chat.. i posted some codes there.

bijaybd Developer · 178 posts #4

brother please check it it will work or not i found as you said -

<?php $browser = explode ('/', $HTTP_USER_AGENT); $ip=file('../text/bip.txt'); $bbrower=file('../text/bbrower.txt'); if($REMOTE_ADDR=="$ip"" AND $browser[0]=="$bbrower"){ header ('Location: [http://urban-chaos.uni.cc/s60realm/chat/yo...ned.php');}](http://urban-chaos.uni.cc/s60realm/chat/yourbanned.php&#39%3b%29;}) ?>

Does it will work for banning so that my admins and owners also can bann

how do i put a perticular time for banning as i will always not able to ban everybody my admins or other owners will ban them on this case what should i do if i want to give a perticular time

chris Junior · 39 posts #5

I did not write that code like that......

But like this:

<?php
$browser = explode ('/', $HTTP_USER_AGENT);
if($REMOTE_ADDR=="BANNED_IP_HERE" AND $browser[0]=="BANNED_BROWSER_HERE"){
header ('Location: [url]http://urban-chaos.uni.cc/s60realm/chat/yourbanned.php'[/url]);}
?>

You will probably need to update the browser string for php5 i just grabbed that from a very old copy of wappychat (use php.net to find out more about ways of getting ip).

Make that into a file and include it on all your pages, repeating the code:

if($REMOTE_ADDR=="BANNED_IP_HERE" AND $browser[0]=="BANNED_BROWSER_HERE"){
header ('Location: [url]http://urban-chaos.uni.cc/s60realm/chat/yourbanned.php'[/url]);}

for each ban, obviously directing to your own banned page.

As for adding time, reasons etc i really can't be bothered it would mean adding a whole new function and wasting a lot of my time on a script i no longer use.

If i ever get back into the script i will do it for the next release (2.0.3)..

The code i posted above is not perfect but you can get the idea..

in thoeroy:

1. get ip
2. get browser
3. check if browser and ip match the banned browser ip
4. redirect

wappy.

bijaybd Developer · 178 posts #6

ok brother can you give me any ideas for the time or any related script like it.

and one more thing is i will add that function in the tools for admins and owners

so if i add 2 files in text folder 1 is ip.txt and another 1 is brower.txt in the text folder

then i will submit the code in the pages like this just check this is correct or not :

<?php $ip=file('../text/bip.txt'); $browser=file('../text/browser.txt'); if($REMOTE_ADDR=="$ip" AND $browser[0]=="$browser"){ // here remote address and brower will get from the file in text folder ip.txt and browser.txt so that my admins and owners also can ban a ip and browser. header ('Location: [http://urban-chaos.uni.cc/s60realm/chat/yo...ned.php');}](http://urban-chaos.uni.cc/s60realm/chat/yourbanned.php&#39%3b%29;}) ?>

is it correct

rukiya Lead · 569 posts #7
<?php
$ip=file('../text/bip.txt');
$browser=file('../text/browser.txt');
$rukiya = explode(" ",$_SERVER['HTTP_USER_AGENT']);
if($REMOTE_ADDR=="$ip" AND $rukiya[0]=="$browser"){ // here remote address and brower will get from the file in text folder ip.txt and browser.txt so that my admins and owners also can ban a ip and browser.
header ('Location: [url]http://yourdomain.com/ban.php'[/url]);}
?>

also depends up to how browser data are being saved in browser.txt

chris Junior · 39 posts #8

What rukiya posted is probably a better method.

As i said about the time and admin functions i have no time to do it now, i will bear it in mind for the next release of the script, sorry but i have my own work to be getting on with and don't even use the script anymore.

You could work out how to add the function by looking at the existing admin functions...

Im also wondering with this method of having two files, will it not ban ALL combinations of the browsers and ips listed? if so that is not how it should work.. it should ban only a set combo like nokia 6630 | 123.456.789.65

bijaybd Developer · 178 posts #9

browser data are being saved in browser.txt will be just like the files have as the banned.txt files like if the nick is banned like a b c d inside the banned.txt if the browser.txt will be the same it will work or not

so how i suppose to save a file in a combo format like nokia 6630 | 123.456.789.65 one

how the other side do that

chris Junior · 39 posts #10

I would personally save the banned details in ONLY 1 file like this:

Nokia 6630::123.123.123.34

If you don't understand how to do this just look through the script, i have used similar methods all over it.

chris Junior · 39 posts #12

Then that would be even better with opera version number, less chance of banning someone else with same ip and similar browser 🙂

bijaybd Developer · 178 posts #13

ok is there any way like this bban/nick --- so it will auto get the ip and browser of the nick and it will ban that nick

chris Junior · 39 posts #14

Yes there is but as i keep saying it would mean adding a whole new function to the script. I will add it in the next release (if there is one) but i have no time to do custom coding work for free.

I don't even have a working demo setup myself.

You could quite easily work it out yourself by using php.net and looking at the existing functions in the admin tools. Thanks.

djdeny Junior · 12 posts #15

open Firefox and enter about:config into the address bar 🙂 then right-click and then from the sub-menu select String. for New string value enter general.useragent.override and click OK! 😉 so you change the Firefox user agent string 😉 and you are not baned 😛

chris Junior · 39 posts #16

Most people would be using a mobile with this script.

But yeah almost any ban can be avoided, infact i can't think of any site or script that could keep someone determined out, including this site.

bijaybd Developer · 178 posts #17

there is a file named iplog.txt is there any way to ban from there with nick cz i saw there for example

::regan 202.56.7.166 Nokia6260/2.0 (3.0515.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0::

so that it will be really easy to ban him with nick

i also found this

08.04.20.17:20:06 HOSTNAME: 202.22.194.218 REMOTE_ADDR:202.22.194.218 HTTP_USER_AGENT:NokiaN70-1/5.0705.3.0.1/SN358637011701767 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1

in the kirjaus.txt file

djdeny Junior · 12 posts #18

it is best to send cookie, so that the user does not know 🙂

chris Junior · 39 posts #19

That log file should of been removed really, we used to use it to get the ips of offending nicknames and used the first browser/ip method as i showed above.

EDIT: many phones don't allow cookies, especially the older wml based ones this script was designed for.

Also scripts like this one, ipb, send cookies on suspension, they can simply be deleted so you can register again.

rukiya Lead · 569 posts #20

QUOTE (bijaybd @ Oct 14 2008, 05:57 PM) <{POST_SNAPBACK}>

there is a file named iplog.txt is there any way to ban from there with nick cz i saw there for example

::regan 202.56.7.166 Nokia6260/2.0 (3.0515.0) SymbianOS/7.0s Series60/2.1 Profile/MIDP-2.0 Configuration/CLDC-1.0::

so that it will be really easy to ban him with nick

I see you have lot of time to make topic,post to get help from others but dont have any time to learn coding. Thats really pathetic.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close