There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard netgear network printer problem ram registry repair router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: php array() HELP IM TRYING TO FILTER USERNAMES

Reply  
Thread Tools
emopoops's Avatar
emopoops has a Photo Album
Computer Specs
Member with 195 posts.
 
Join Date: Jan 2009
Location: america c- ountry
Experience: pretty experinced ;]
07-Oct-2009, 04:31 PM #1
Question Solved: php array() HELP IM TRYING TO FILTER USERNAMES
i have this script it wont display the page if i have over like 30 things in an array. wtf but it will display if theres only like 20. does anyone know what i can use instead of array() because i have like 100 things i need to use in an array

heres the code im working on to make sure that people cant register on my site with prohibited words in their usernames they pick:

Code:
$lowercaseusername = $username;
$lowercaseusername = preg_replace("/[^a-z]/i", "", $lowercaseusername);
$lowercaseusername = strtolower($lowercaseusername);
$banned = ("this", "times", "like", "100");
 
 $trimthex = trim($lowercaseusername, "x");
 var_dump($trimthex);

function stristr_array( $trimthex, $banned ) {
    foreach ($banned as $singleword ) {
        if (strstr($trimthex, $singleword) != FALSE){
        exit("cannot have $singleword in your usernname!");}}
}
MMJ's Avatar
MMJ MMJ is offline
Senior Member with 3,637 posts.
 
Join Date: Oct 2006
08-Oct-2009, 01:21 AM #2
line 4 makes no sense and wouldn't compile.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:11 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.