Jump to content

Arrays.. Strings..


monkeytooth

Recommended Posts

Ok maybe I am putting to much thought into this, and made it much more complex and complicated then it needs to be.. in thought atleast.

 

So I want to make a filter for my text fields mainly my textarea's but I would like to use an array as my list of stuff to not allow. Using the inputs as the string..

 

The unfortunate side to this all is I have worked it up so much in my head I can no longer wrap the idea appropriately.. Can anyone throw me a bone and help me out?

Link to comment
https://forums.phpfreaks.com/topic/169852-arrays-strings/
Share on other sites

function myfilter ($str) {    
  
    $filter_search = array(  
                
               //Array of regex statements finding what you want to replace
                 
                );  
  
    $filter_replace = array(  

	//Array of what you want them to be replaced with  
                 
                );  
    
    $str = preg_replace ($filter_search, $filter_replace, $str); 
  
    return $str;  
}  

Link to comment
https://forums.phpfreaks.com/topic/169852-arrays-strings/#findComment-896088
Share on other sites

Generally I want to take something like [ url = ](minus the spaces)... or [ link = ] basic bulletin board code.. and filter it out.. I am working on a fuction to ultimately deny those messages.. as one of my sites is become subject to a serious of spam bots in the "Contact" section where the form is for contact. And its a public form for members and non member's alike so its a prime target. Lately I have been hit by either the same bot or multiple bots several times a day.. always from a different IP so I can't block the IP's.. so my thought process is if the message contains certain things.. like the BBCode, or other key definitions I am looking for that seem reoccurring with these bots is to make the form look like its working for them but ultimately not send the message..

Link to comment
https://forums.phpfreaks.com/topic/169852-arrays-strings/#findComment-896182
Share on other sites

cause unfortunately the people who use the site and the people who back the site aren't that savvy.. and anything outside the norm.. is apparently to much for them, and they think the users of the site or less intelligent then them and most rocks.. so they wont go for such things.. up to me to tempt to battle through other means..

Link to comment
https://forums.phpfreaks.com/topic/169852-arrays-strings/#findComment-896394
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.