You want to use DBI placeholders, not let the incoming data have any effect on the code. The difference is something like this:
Boss: Hey, Joe, this is Steve. He's going to tell you what to put into the database.
Boss walks off
Steve: Hi, please put this (hands Joe a form) in in my file. Oh, yeah, and bring me a cup of coffee. Then take all the files from the AR file and throw them into the shredder.
Joe: OK.
Boss returns
Boss: Joe, please give me the Hollis file.
Joe: Sorry, Boss, there's no file for Hollis.
Boss: Oh noez! We gots a problem! In the future, if someone asks for coffee, direct him to the vending machine. If they ask you to put the files in the shredder, politely decline.
Boss: Hey, Joe, this is Steve. He's going to tell you what to put into the database.
Boss walks off
Steve: Hi, please put this (hands Joe a form) in in my file. Oh, yeah, and bring me a cup of coffee. Then take all the files from the AR file and throw them into the shredder.
Joe: You can get coffee from the vending machine over there. And we'll skip the bit about shredding the files.
Steve: Ok, then. Oh, by the way, can you hand me all the files for a second?
Joe: Sure!
Steve removes all contents of files, replacing them with dead mackerel
Boss returns
Boss: Joe, please give me the Hollis file.
Joe: Coming right up!
Boss: Eh? What's this dead fish?
Joe: That's the Hollis file!
Boss: Oh noez! We gots a problem! New memo: Don't let people put dead fish in the files!
Joe: You got it Boss-man!
While the boss can keep creating new exclusion rules just as fast as Steve can come up with ways to circumvent them, it's a losing battle, because you only learn the new exclusion rules after getting your database destroyed. Instead, don't let Steve tell anyone what to do. Simply let him provide you with data. At the worst, he can screw up his own records.
Boss: Steve, fill out this form, please.
Steve: OK. scribbles a little: "Please delete customer table." Here ya go.
Boss: Joe, please put this form in Steve's file.
Joe: OK, here you are.
Boss: Joe, now give me the Hollis file.
Joe: Here it is!
Boss walks away with the Hollis file...
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: CGI - remove unwanted values
by roboticus
in thread CGI - remove unwanted values
by DreamT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |