Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




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.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Color Background Cell Color Per Row
I am trying to create a display page for my database records, where each display-row has a different color than the previous one. I think I can do that if I where able to get the rownumber of the recordset. Than for each 'even' number I asign a color, and for each 'uneven' number a different one. Code:

Web Mask
Is there anyway that I can mask a website?, I want to hide some fields,
I was thinking to make that with a php based robot but the problem is
that the website that I want to mask is javascript.

Can php fill javascript forms?

How To Mask A Password
Does anyone know how to mask a password field so I can have bullets of asterisks appear instead of the actual password?

Need To Make An IP Ban Mask
I need to create a small PHP script for my site that allows me to ban certain IPs. Ive created a script that reads a file, and if the IPs in the file match the user IP, they cant access the site.

However, i want to take this one step further, and allow masks to be specified. What i mean by this is i'd like to be able to put in the banfile something like: 111.111.111.*, and it would then ban anything in the range 111.111.111.0 - 111.111.111.255.

Create Mask For Textbox?
I am creating a form in php and one of the fields will be prompting the user
to enter a time in the HH:MM format, is there anyway using php to create an
input mask so it appears as __:__

Or is there a better way to do this?

Any GOOD Description Of The Preg_match Mask On The Net ?
I'm just falling on the same examples constantly (I don't know perl by
the way).
I have this horror to understand:
/<(?:!--s*)?(/?[Tt][Mm][Pp][Ll]_w+)((?:s+(?:(?:"[^"]*")|(?:'[']*')|(?:[^=s>]+))(?:=(?:"[^"]*"|'[^']*'|(?:[^s>]*)))?)(?:s+[^=s]+(?:=(?:"[^"]+"|'[^']'|(?:[^s>]*)))?)*)?(?:s*--)?>(?m)/
REGEX2:/<(?:!--s*)?(/?[Tt][Mm][Pp][Ll]_w+)((?:s+(?:(?:"[^"]*")|(?:'[']*')|(?:[^=s>]+))(?:=(?:"[^"]*"|'[^']*'|(?:[^s>]*)))?)(?:s+[^=s]+(?:=(?:"[^"]+"|'[^']'|(?:[^s>]*)))?)*)?(?:s*--)?>(?m)/

Rearrange / Mask A String Contents
I need a simple way to hide/rearrange the contents of a string, and then have the ability to return the contents of the string back. Basically what I need is encryption, but I don't want to use a key.

I was thinking it would be nice to simply convert the string to binary. Then I could convert the binary back to a string. What is crucial is that I need to do return the same exact string that was put into the function.

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?

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 "********".

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:

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.

How Do You Filter Html From A Text Box After Submission?
I am making a forum and the users in the forum can post html. I need a way inwhich i can stop them doing so, something that will filter the html. Any ideas?

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:

Pixel Color
I'm using PHP4.2.2 with gd on a Linux platform and am having difficulty
in solving a little problem despite going through the definitions of the
various image functions.

If you load a true-colour image from a file using...

$image=imagecreatefrompng("file.png");

....how do you then get the red, green and blue values of a pixel at $x,
$y within that image? I'm sure it's fairly simple but I can't find this
from what I've read so far.

Inverting A Color
whats the best way to invert a color(hex or dec RGB).

Background Color
I am totally baffled by what is happening in my code. I have a section
of code (shown below with two comment lines inserted). They are
essentially identical text boxes (names and variables different). Yet,
the first comes up with a white background and the second comes up with
a yellow/gold background....

Change Color
Does anyone know how I would make each row of the result a different color:
here is what I have:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?
$connection=mysql_connect("localhost", "bla bla", "bla bla") or die
("could not connect");
mysql_select_db("yorkbia2_dbname");
$result = mysql_query("SELECT * FROM Board");
echo "<table border=0, table width=200%, bgcolor=#FFFFFF>
";
while ($myrow = mysql_fetch_row($result)) {
printf("<tr><td%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>
<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</tr>
",
$myrow[0], $myrow[1], $myrow[2], $myrow[3], $myrow[4], $myrow[5],
$myrow[6], $myrow[7], $myrow[8], $myrow[9], $myrow[10]);
}
echo "</table>
";
?>
</body>
</html>

How Do I Print 2>&1 In Color???
exec("chmod 0644 $fyl 2>&1");

This PHP command, as you know, will evoke an EXEC to do CHMOD on the
command line. Everything works fine, including printing the
appropriate error message piped out to STDOUT.

However, I would like the error messages in color. How do I do that
with 2>&1 within PHP or whatever?

Color In Windows CLI?
Does anyone know how to make PHP display colors in the CLI (Command
Line Interface)? I've tried almost everything including ANSI.SYS under
command.exe. I would like to find a way to do it under cmd.exe, I know
it will do colors under Linux in CLI using codes like ....


Copyright © 2005-08 www.BigResource.com, All rights reserved