Outpost Universe Forums

Off Topic => General Interest => Topic started by: CK9 on January 11, 2005, 06:07:02 PM

Title: Gahh!
Post by: CK9 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?
Title: Gahh!
Post by: BlackBox 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))
Title: Gahh!
Post by: CK9 on January 14, 2005, 11:15:21 PM
lol, if only I had access to mysql...I hope that can work well enough
Title: Gahh!
Post by: BlackBox 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.
Title: Gahh!
Post by: CK9 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?
Title: Gahh!
Post by: BlackBox on January 25, 2005, 04:54:56 PM
do that in the one that processes the message prior to posting it.