Topic awaiting preservation: Language filter |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: The Dark Side of the Moon |
posted 01-05-2003 09:39
Hey there. I have a quiz generator on a site for a client and I need some help. The Quiz generator is Quirex (found at http://www.teca-scripts.com/free/quirex.php). The problem is that some people have been using foul language when they enter thier name in the form. Is there any way I can add a mini filter to prevent certain words from being used in the form? The line of code that inserts the 'Name' section of the form reads as follows: |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-05-2003 12:34
you're using php, right? code: $words = array(
|
Paranoid (IV) Inmate From: The Dark Side of the Moon |
posted 01-06-2003 04:47
It is actually a CGI script. It calls on a file called 'showquiz.pl' to give the form to where you enter your name. Exactly how do I add this code to the form? I tried a couple ways, but I keep getting a 500 error. What am I doing wrong? I tried it like this: |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 01-06-2003 04:58
wouldn't this: |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 01-06-2003 18:49
well, it shouldn't, petskull. after all, it only comments out the rest of the line, and there's a linebreak afterwards. |
Paranoid (IV) Inmate From: The Dark Side of the Moon |
posted 01-06-2003 20:07
Well, Pet, any thoughts? |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-06-2003 20:39
I'm looking at this script and totally lost on where you want to do this. |
Paranoid (IV) Inmate From: California |
posted 01-06-2003 21:31
I haven't had a chance to look at the code yet but it should just be a simple substitution. Something like this will work: code: my $text = 'This is a test of bad word substitution. Let\'s see if the bloody thing works!';
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-06-2003 21:35
dammit I knew it could be done in one line. I'm always learning with perl |
Paranoid (IV) Inmate From: California |
posted 01-06-2003 21:44
quote:
|
Paranoid (IV) Inmate From: California |
posted 01-07-2003 05:13
I'm lost looking at that code too. The only place I can see to filter bad names is around the line 130 area of showquiz.pl: |
Paranoid (IV) Inmate From: The Dark Side of the Moon |
posted 01-08-2003 21:23
Thanks for the help Piper. I added the code as you suggested and I did get an error. The error log told me this: |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-09-2003 00:25
yep first UBB (this forum) put's a space between two "pipes" ( |
Paranoid (IV) Inmate From: California |
posted 01-09-2003 02:22
Thanks, bitdamaged. I did not notice that when I lookd over the code. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-09-2003 04:06
Yeah that's one of those things you'll miss, it just comes up in this forum everytime someone uses an or operator |
Maniac (V) Mad Scientist From: 127 Halcyon Road, Marenia, Atlantis |
posted 01-09-2003 05:05
damn.. looks like I'm late! |
Paranoid (IV) Inmate From: The Dark Side of the Moon |
posted 01-12-2003 09:16
Mega Kudos to Piper and Bit! The new addition works wonderfully! I will name my first born after you! |
Paranoid (IV) Inmate From: California |
posted 01-12-2003 17:19
Awesome, I'm glad that worked for you. |