I'm trying to add a content filter (banned words filter) onto a web proxy. When the Javascript detects any of the banned words on the page, it should:

* As soon as a banned word is detected, it should not check for any more but immediately echo/print on screen/display a warning to the user with the first banned word spotted:"Banned word "blah" found on page. You will be redirected to Google".* Then, redirect to Google.* Dump to database the banned word found, and the url of the page the banned word was found on. Eg.

Banned Word Found|Url|Date & Time of the Server--------------------------------------------------------ass|donkey-ass.com|25-01-2007, 03:00:00

The only requirement is that, I should be able to feed a list of banned words it should check for.

What would the code be to do all that ?I'd like to code see samples.I'm trying to build one in php but the php gurus say it is best the banned words checking is done on client-side. Else, the page would take too long to load (high cpu usage) if the checking is done on server side. I have no experience in writing Javascript code.

You see, I want to run a public web proxy but I do not want my users viewing sites containing banned words. If I have 1k banned word and a page contains 1k words then my current php filter has to loop 1k*1k=1m times on a single page to check for banned words. Now, imagine the cpu usage. My host likely to object. On top of that, when thousands of users simultaneously use my web proxy then you can imagine how slow my service would become to load pages.That is why at Stack Over Flow the php guru who is helping me build the php filter, suggests I look into the JS filter instead.

I have now been told that, many people surf with java and javascript disabled. Nothing would run with these surfers (web proxies). Plus, anytime I do something client side, it can be faked. In other words they could remove all banned words on the fly before my javascript ran. So a page with a banned word would appear to you as fine!This is shocking news for me indeed! Client-side can be faked ? How ? You JS experts care to elaborate more ? I have to learn this loophole to prevent maliciousness in the future.So, what is the solution then ? I mean, the php filter would be too slow and the page would load slowly and my users would get fedup and ditch the free service. What would you do if you were in my position ?

I do not know JS atall. I'm struggling with php. Can't take 2 giants all at once. If I can find a ready made script online then using my common sense I maybe able to customise it according to my needs asking a little here and there on many forums and reading a little tutorials (but I do not have the time, nor the patience to learn the full language) then I'll share the final version on all forums. Thus, I contribute back to the forums that helped me a little.I'll google and see if I can find any free samples. I might find a few on Stack Over Flow.

You know my php project is nearly finished. I added a link click logger onto a free web proxy to log what users are browsing (with their permission). I wanted to add a words filter (banned words) so users don't view forbidden sites nor my proxy logs them. However, the php forums failed to advise me that the filtering is best done at the client side rather than server side. Else, the service will become slow. I learnt this at Stack Over Flow. Even though my php words filter is finished. I reckon the JS word filter would be best for my project.

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum