![]() |
|
#1
|
|||
|
|||
User input filteringOkay so I've got a form where users input basic information (name, username, password, address, etc) and I want to filter it to make sure users aren't inserting code, including whitespace, using incorrect chars, etc.
If anyone has the script to do all of this already, I would love to have it, but I have planned to build it myself. This may be an ongoing post as theres many aspects to filtering user input. BUT, my immediate question is how do I count whitespace ONLY (no text).... This is the code that I'm using (that isn't working): PHP Code:
Thanks in advance for help, crazygol4 |
|||
|
#2
|
|||
|
|||
Re: User input filteringOkay I've got a fix for it:
PHP Code:
So that code has some test features in it, the below code will do all the work without displaying, and will redirect to a different page if the string contains whitespace. PHP Code:
Hope this is helpful! -crazygol4 |
|
#3
|
|||
|
|||
Re: User input filteringLooks like you could get a yes or no answer in one line by using: strpos( string, find [, start] )
PHP Code:
|
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble integrating console code into GUI | Barman007 | Java Forum | 18 | 15-May-2008 14:05 |
| Scanning dilemma (fscanf and fgets) | aijazbaig1 | C Programming Language | 10 | 29-Mar-2008 05:58 |
| Need help with validating user input. | Emmy | C++ Forum | 4 | 19-Aug-2007 12:07 |
| bit operations on a string | axel2500 | C++ Forum | 6 | 21-Aug-2006 16:52 |
| Need Help on checking user input | hihellochao | C Programming Language | 5 | 27-Feb-2004 14:30 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The