Author Topic: Gahh!  (Read 1410 times)

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Gahh!
« on: January 11, 2005, 06:07:02 PM »
well, once again I am getting advertisers in my GB...is there a code I can ad into the file to block out URL's containing keywords?
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Gahh!
« Reply #1 on: January 13, 2005, 02:40:44 PM »
like if you want to block out / censor certain words?

You'd need to go into the PHP, find the part where it processes the form input, something like this I'd imagine: (This isn't exact though)

// Where the form data is processed... (or top of page, within <? ?> block of course)
if (eregi("(>[^<]*)(word you want to block goes here)", $_POST['name of form variable here'])) die("message to display if blocked word is found");


You might even do it at the top of the page before anything else (one word of warning: formatting will be screwed up possibly, using die() because the script execution terminates after the die() command. It will cause the post to stop (as long as this is done BEFORE the data gets written into the database (look to do this before a mysql_query() command))
« Last Edit: January 13, 2005, 02:44:19 PM by op2hacker »

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Gahh!
« Reply #2 on: January 14, 2005, 11:15:21 PM »
lol, if only I had access to mysql...I hope that can work well enough
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Gahh!
« Reply #3 on: January 15, 2005, 02:01:40 PM »
How does your guestbook store data? In a file I presume.

It doesn't matter how or where it stores data, just make sure you do something like the above before it stores the data.

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Gahh!
« Reply #4 on: January 16, 2005, 06:39:09 PM »
heh, it stores it where I have no access...will it work if I put that in the main file, the one that access the messages?
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Gahh!
« Reply #5 on: January 25, 2005, 04:54:56 PM »
do that in the one that processes the message prior to posting it.