Creating Profanity Filter
I'm creating a profanity filter for my message board. I've created the following code:
// $filter is the array that contains the bad words
foreach ($filter as $word)
{
$name = eregi_replace($word,"*****",$name);
$email = eregi_replace($word,"*****",$email);
$subject = eregi_replace($word,"*****",$subject);
$body = eregi_replace($word,"*****",$body);
}
The code works, but every word is being replaced by "*****" (5x*). That is not what I want. What I want to do is replace "doh" with "***" and "superdoh" with "********".
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Php Filter
I made a chat room with php and now im trying to make a bad word filter cna someone help me? not to code but to lead me in the right direction heres the script i have now thats not working Code:
Php Content Filter
I have made this script to filter content based on the given url. i need to make all the links on the page go through this script, so i added an str_replace and its not working, the links don't get modified.
Filter Arrays
there's an array where i want to remove one entry. so i use PHP Code:
Input Filter?
i have been searching for a good input filter class or how-to guide. All I found were vague concept descriptions or alpha-release or more than a year old, dead projects. Isn't there a comprehensive class to filter user inputs for specific purposes such as display, sql storage and filter features such as specific html tags, filter JS, etc etc?
Content Filter...
Would it be possible to make a PHP script that actted as a simple proxy server? I want to build a script that IE uses as a proxy, then i want to check the page for bad words and if its okay display it.
Drop Down Filter
I've got two drop down menus that I'm using to filter some data. It works when the user selects an option from both menus but always return ZERO records when only one of out the two menus have been set. My code POSTS the ID from each menu then puts that ID into the WHERE clause of an SQL query. Code:
Gzip Filter
I want to config gzip on apache server so that it compress everything except streaming files and images. I did AddOutputFilterByType DEFLATE text/plain text/javascript text/html. But it seems that certain request for file/image data gets gzipped as well. for example client sends a request http://myhost/file_streamer.php?id=101, my file_streamer.php respond with: Code:
Word Filter
I know there are many topics regarding Word Filters but I couldn't find one for this particular problem. I want to create a Word-Filter script which ignores workarounds such as spaces (B adword) or BB-codes (Badword). Any ideas on what specific code snippets to prevent those?
Strip_Tags Using Filter
I am trying to make code that will let users upload images and embeded object tags via a simple web form. I have it working correctly, it does what i want it to: user uploads say from a web form. it gets dumped into the sql table. this is the "behind the scenes" code that works on the form submission: Code:
Image Filter
The image size filter works but not the file extension filter. Would like a check to see if file exsists too. Code:
Spam Filter
anyone know a good spam filter for my linux email box...
How To Filter The Words In HTML ?
I face some problem that I want to filter the all words in HTML. Example: Before Filter: <div id="pp"hello man <br/Thank's for your answer. </div> After Filter: <div id="pp"<br/</div> What I want is reserve all HTML tags but words. Is there any good packages or classes or suggestion?
PHP Mail() And AOL Spam Filter
dodging AOL's spam filters when mail()ing from PHP? We are having trouble with this code: $fromEmail = 'aValidAddress@thisHostAccount.com' $headers = 'MIME-Version: 1.0' . " "; $headers .= 'Content-type: text/html; charset=iso-8859-1' . " "; $headers .= "From: This Foundation <$fromEmail> "; $headers .= "Reply-To: This Foundation <$fromEmail> "; $headers .= "Return-Path: $fromEmail "; $headers .= "Message-ID: <".time()." TheSystem@". $_SERVER['SERVER_NAME']."> "; $headers .= "X-Mailer: PHP v".phpversion()." "; mail($to, '$subject, $msg, $headers); We had originally been sending bounces to a different Return-Path address (see below) but simplified this after AOL flagged all the emails as spam. Also the To field is being set like this RealFirstName RealLastName <Addressand the message has a greeting using the RealFirstName. mail($to, '$subject, $msg, $headers, "-f bounce3@gnosports.com");
Bad Word And SHOUTING Filter...
Is there a simple way to go through a textarea input determine if certain words from a list (an array?) are present? And, related, sort of... Is there a simple way to determine if a textarea contains "too many" upper case characters ("shouting")? That is, count how many are UPPERCASE and how many not?
Adding A Filter To My Shoutbox
I have a simple shoutbox thingy that I use to display simple messages. It works fine as it is, but there is no error control or filtering etc.. I would really like to add a swear filter to it, but I'm not sure how. I tried using PHP Code:
Color Mask/Filter With GD?
Has anyone had any luck with trying to create a image mask with gd. I've gone through most of the manual and the closest thing I could get was http://www.php.net/manual/en/functi...phablending.php I want to put a color layer over and image that makes it look like it has a blue tint or red tint etc. The GD Manual isn't really any help either.
Displaying Images With A Filter
Wondering if someone can point me in the right direction. Im trying to display images from a directory, but i need to filter them. Like a wildcard, for example to display all images ending with *1h.png or to display images starting with cpu0*.*
Image Size And Ext Filter
I have been testing my image filters and have a few problems, for some reason it blocks .exe, .rar, .zip and a few others i have tested and does the if else code, but .psd .pdf (i have yet to test more)slip through the else code(they dont get uploaded but it creates a empty record. Not what i want. (why would it do that when in my array i only include, jpg, jpeg, gif and png files) The other problem is that it recongnises a jpeg if over the size limit and does the else code but png files bigger that the allowed size skip the else code and create an empty record(they dont get uploaded either) Code:
Image Upload Filter
I have this code i usethat works fine, except that any filr can be uploaded and any size. How would i add some code to check that the file is a jpeg, gif or png and is under 1 meg? Code:
Filter Links Out Of Comments
last week I posted a link to my site where people can leave comments and some low-life decided to post links on that page. Is there someway to filter out links? I dont really want to use the htmlspecialchars() or the htmlentities() to simply disable them, I want to block them altogether. Maybe some way to filter out "www" or something?
Filter To Omit Based On Certain Url
I have a script that will send an error for 404 emails. I want to exclude urls from a certain directory. How can I make it so they wont submit if /example is in the url? The code works fine I just want to filter out. Also you will see that I have defined REQUEST_URI this is because I have php on IIS, not my choice. I am somewhat of a noob, so if you can make your answer as simple as possible I would really appreciate it. Here is code:
How Do I Filter A Table Of Links ???
can anyone suggest a way of dissplaying a table of links from a mysql table but not display a link if a value is preasent in a colum of the mysql table ?
Filter Results Of Query
I am modifying some pages in CRE Loaded. allprods.php list all currently active products and I added a manufacturers column that displays who makes that product. I want to allow shoppers to filter the product list so that it shows only products from a particular manufacturer. I have gone through several scenarios in my mind, but nothing I've thought of seems simple and bullet proof. One of the issues is that the all products query includes all manufacturers. If I were to put a variable in the query to select only a particular manufacturer, how would I code it so it does not interfere with the all products query? Would logic based upon the value of a form action work? If form action exists, someone wants to filter. If not form action or form action = all, then they want the whole list. Seems like filtering a list is pretty common and there should be an easy solution.
Array Word Filter?
got a comment/blog type thingy and in the users preferences they have the option to turn a bad language filter on/off. Im just wondering the quickest way to implement this to view the output? You think put the words into an array and if the word filter is true, then how would i go through all the array of bad words and replace with *** and would this be quick or would it delay viewing the output?
NuSOAP Problems With Google Web API + Filter
The Google Web API's "Filter" used to work for me: I set it to true using PHP/NuSOAP and didn't get multiple pages from the same domain, or if so, at most one additional one and this being marked specifically. Lately, it doesn't work anymore for me. Example? Compare this <http://blog.outer-court.com/search-css/?q=google+blog> result with the official result on Google for <Google Blog>. The first domain hits me thrice in the first example.
Bypass Hotmail Junk Filter
I am sending mail through php mail() function, mail goes in inbox in yahoo.gmail,other but only in hotmail it goes in junk. first i thought there was a problem with the text then we tested the text through our hosting mail account and when finally we succeeded in bypassing hotmail filter the mails started going in inbox if i sent them from a mail account i create at the server test@... but when i used the same text with php mail() function it still is going in junk plz see below the code i used i added alot of headers but it still goes in junk plz help how to bypass junk .....
[error] An Unknown Filter Was Not Added: PHP
I'm getting this error in my error_log in apache. Can anyone offer any assistance in fixing the problem? I'm using RH 9 with apache 2.0.53 and PHP v4.3.11 [Fri Apr 29 09:32:03 2005] [error] an unknown filter was not added: PHP .........
[error] An Unknown Filter Was Not Added: PHP
Anyone know why this message would appear in my error_log. My PHP code executes fine...but it is outputting this to my error_log and I cannot figure out why. I've been looking for a couple days...but have not found any reason/fix on the web for this message. My php.ini and php.conf look fine.
Mail() Blocked By Spam Filter
I never had problem with this PHP page with mail() function with at least 5 different servers, but email sent through the server of this "T" company tends to get blocked by spam filters. I tested with my different email accounts and these are the results. * The mail is delivered to the "Inbox" of my AOL account. * The mail is delivered to the "Bulk Mail" folder of my hotmail and msn accounts. * The mail is delivered to the "Spam" folder of another account of mine. * The mail is not delivered to any of my two university accounts. One thing I noticed is that this "T" company hasn't setup the "From" section, unlike the other servers that I worked with before, so the mail is coming from "Nobody" <nobody@________>. I suggested the tech person of the company update the "php.ini" file, but he doesn't admit that's the issue. I tried manually adding the From with PHP coding with "$headers," but it didn't make any change.
Make A Dropdown-menu Filter?
I have a dropdown menu which is supposed to filter a table to show results for professionals, students or all. But I don't really know what I'm doing. This is what I have so far. Code: Initially, I was able to filter for students or professionals, but since trying to have an all option (students and professionals) it has gone to pot, and I keep getting errors. I know that my quotation marks are not right, but I can't think of a solution. I would be more than happy to see any ideas, even if they are completely different to mine!
Filter Mysql Query With File_exists() ?
i am trying to filter the results of a mysql query with file_exists() i have a database of products with one of the columns of data being the product image url. i want to retreive the results for only the proucts where the pImage exists. i have the following code:
Offensive Word/phrase Filter
I've got a function that is being used to filter messages before they're inserted into a database that gets rid of any foul language and replaces it with either **** or an alternate word/phrase. The problem is it replaces parts of other words. For example, the word Assault gets replaced as: ***ault. Can someone please help me modify this so it only replaces whole words? I was thinking maybe putting spaces around the word to check it, but this will cause it to fail on words at the beginning of the text or with punctuation after or around the word (like "bleep" or bleep.) here's the function: Code:
Howto Use Php As Filter For HTML Files? Curl?
In short, how to modify selected tags/sections of a HTML file, using PHP as the "modifier"/filter? I would have thought this was a very common usage for PHP... I have a set of existing .html files that are plain and ugly. I'd like to create a showdoc.php filter that adds consistent menus, css, look and feel, so that http://me/showdoc.php?d=story shows a nicely formatted http://me/story.html It: * puts in a nice standard header * opens story.html * extacts all <link> and <script> tags from the story <head> and adds them to the output <head> * extracts everything between <body> and </body> * rewrites all non-absolute hrefs e.g. <a href="other.html"> to <a href="showdoc.php?d=other"> * closes story.html * puts in a nice standard footer I realize I can do this by editing all the .html files instead, but can't I just use php as a filter? Am I the first person to want to do this? How? * I _really_ want to avoid using regexps to match e.g. body and hrefs, because there are so many caveats involved. Multiline tags, attributes, for starters. Or how about <nasty attr="</body>"></nasty> (not sure that really is legal, though...) * xml_parse() parses XML and HTML is not XML (e.g. valid HTML missing </end> tags) so xml_parse is out. Or what? * Since I want to preserve all the <body> except the rewritten hrefs, if there is a parser involved, I'd like for any parser to produce output that is easy to re-flatten when generating output. There are examples out there using CURL, but they often are so simple that they don't print out *anything* on their own and only the output of curl_exec(). In any useful application, wouldn't everyone have to extract selected info from the retrieved web page? What do CURL users do?
Simple Filter Of Database With $_GET And Select SQL
I need help with my logic statement with a simple search engine on a MySQL table. I have three form text input fields named f_name, l_name and dept. I am using the GET method to gather data the user enters in each input field. So far I have been able to build a check to see that the submit has been clicked but I am having trouble with assembling the SQL statement because I need for the search engine to be able to filter the results based on the information provided in 1-3 of the fields. I could use if statements with some and clauses but that would mean that I would have to account for each combination. Something like If(($_GET[‘f_name’] != “”) || ($_GET[‘l_name’] !=) || ($_GET[‘dept] !=)){ $sql = "SELECT * FROM facform WHERE f_name LIKE '$_GET[f_name]', l_name LIKE '$_GET[‘l_name]', dept LIKE '$_GET[dept]' ”;} The problem with this is that I would have to get every combination and it’s not very scalable. How can I create this SQL statement dynamically? Code:
Image Type And Size Filter For Upload
I have this code that works well for me.Just need the added function to check that "uploadFile" is a jpeg, jpg, gif or png and is no bigger than a meg. Code:
Company's Form Mail Script Jams To Spam Filter
I have a problem, because we have a simple script that sends mail from (our client) company's website to that company's boss. But just some days ago post stopped coming, suppose because that email provided he's using implemented more strong spam filter after some spamming attacks. Now that program in my opinion seems to think that our form mail is spammer! I suppose it must be about header information. How can I get our form working again? We only have used simple mail command with to, subject and message - no additional headers. But now? ************************* Here is docs from php site, so you dont have to find them :-) Example 2. Sending mail with extra headers. <?php mail("nobody@example.com", "the subject", $message, "From: webmaster@{$_SERVER['SERVER_NAME']} " . "Reply-To: webmaster@{$_SERVER['SERVER_NAME']} " . "X-Mailer: PHP/" . phpversion()); ?> The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option. You may need to add the user that your web server runs as to your sendmail configuration to prevent a 'X-Warning' header from being added to the message when you set the envelope sender using this method. Example 3. Sending mail with extra headers and setting an additional command line parameter. <?php mail("nobody@example.com", "the subject", $message, "From: webmaster@{$_SERVER['SERVER_NAME']}", "-fwebmaster@{$_SERVER['SERVER_NAME']}"); ?>
Php Script To Filter A Text File And Extract Lines Starting With Keyword?
For a class, students are going to run an experiment on line. Each time a subject runs, his/her data is appended to one giant text file. Their own data set will be just one line starting with the keyword they gave as identification. The faculty does not want the students to be able to download and see the giant data file. He wants the students to only download and see the data that starts with their own identification tag. in unix, filtering a file to keep only the line starting with code MCB would look something like tail -f your_file_name | grep MCB from what I read. Given the concerns the faculty has for protecting the database, what do I need to look into to write a php script that would access the data file, but only show a web page with the data corresponding to the students identification code?
Creating XML In Php
I have a website that is hosted on another machine not under my control. i want to be able to use a file to share info between pages. one page inserts into the file and the other reads from the file. i wanted to use XML because there would be a lot of fields and some would variable length or values. i'm looking into the XML functions with PHP however they all seem to read an XML document. is it possible to have one write an XML document?
Creating Dir
I wanted that when users register on my site, automatically a directory would be created, The problem is, when submiting the registration form via HTTP, the user nobody doesnt have the permissions to create this directory. So I tryed ftp_mkdir. And it worked. The problem is... the directory permissions where automatically set to 655. How can this be changed? Chmod will not work here, because the user is nobody.
PHP - Creating DB
i have a form with textbox default value='10', i want to add to database, and changes made on this page will update into database. this is my form field : <input type='text' size='1' name='$i' value='10' /> $i is for loop that prints outs textbox What column do i create in mysql db and how do i assign the each value of textbox ? for example if i create table example... Create example(date date, qty int); how do i insert each textbox value and each day date into database?
Creating PDF
I need to create a pdf on the fly from 6 fields of my database. What my question is, is how can I make sure that the pdf created is in the landscape profile, not the portrait profile? I have never created PDF's on the fly from a db before.
Creating An Image
I am making a links page for my site that takes the links out of the database and displays the name on a button, but the text on each button is different lengths and I was wondering if there was a way I could align them center on the button? This is the button.php code: <?php header ("Content-type: image/png"); $string = $_GET['text']; $im = @imagecreatefrompng ("button1.png"); $text_color = imagecolorallocate ($im, 255, 255, 255); imagettftext($im, 10, 0, 5, 35, $text_color, "c:phpfontsariblk.ttf", "$string"); imagepng ($im); imagedestroy($im); ?>
Creating Directory
I am trying to make my webpage create a file for each person that submits a file, so at first I was using... $myfile=fopen("create/$user.txt","w"); This worked, and it would create the file if it was not there. Then I decided that each user would recieve their own directory, and that the first file to be edited was called options.txt, in their user directory. So, I used this: $myfile=fopen("create/$user/options.txt","w"); But it came back saying that the directory did not exist. Is there a way to create a directory along with the new file that goes into it?
Creating Pdf File
Is it possible to create a pdf file from a HTML form. i want to create a pDF file from HTML form which looks like the scanned copy of HTML form. I hope there must be somebod< who can answer this question.
Help On Creating Images With GD
I'm using a class to easily create plots and charts: 'GRAPH' by Herman Veluwenkamp downloadable from: http://phpclasses.upperdesign.com/ The problem I've found is the following: -When using Win9x-PHP4-Apache all is OK -When using Linux-PHP4-Apache plots appear as viewed in a mirror (both text and numbers) Does anyone give me a clue about what's happening?
Creating Files
I was wondering, if/how do you create a file with PHP, Im making a "network" for my site with PHP, and ran across this problem.
Help In Creating XML File From DB
Hi friends i need to get the details from two tables for creating one XML file.. for that, first i started by defining a DOMXML object $doc = domxml_new_doc(Ƈ.0'); and i have one outertable query as $outer_table = 'main_category' $query = "SELECT * FROM $outer_table"; $resouter = mysql_query($query, $mysql_connect); and when its first row is read its creating elements by $child = $doc->create_element($fieldname); $child = $outer->append_child($child); $value = $doc->create_text_node($fieldvalue); $value = $child->append_child($value); and i need to get some details from second table with its subcategid=maincategid to do this i need to get that particular field that alrady appended to the xml How i can..... i tried get_elements_by_id() but it returns only those elements that comes under it.]
|