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*.*
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Displaying Images
This page is meant to display all images in a directory. The prob is, it wont display all of them, partly down the page it only shows image names. Also, should I have the page split up? How? Code:
Displaying 5 Images In A Row
I have spent serveral weeks trying to figure out how to do this. Attached below is code for a function that outputs images in a row. However I am tring to find a way so that it would output 5 images and then drop a line and continue to do this untill all the images have been displayed. The variable which the output is stored in is named $out (towards the bottom). The variable $thumb_row is the total number of images that are allowed to be displayed. Here is an illustration of what I am trying to do the X is an image. XXXXX XXXXX XXXXX XXXXX Code:
PHP, MySQL And Displaying JPG Images
I got a script that is supposed to display a JPG image from the database, but, instead of displaying the image, it displays the JPG binary output with those alphanumeric characters. Coule this be a Header MIMI type problem in my script?
Displaying / Resizing Images
I'm trying to create a php page to automatically display all images in a directory I specify, I want all the images to be thumbnailed on the fly, this is what I've come up with so far.... <? $TheDirectory = dir($ImageDir); while($Filename = $TheDirectory->read()) { // Make sure we only show graphic files! if ((strstr($Filename, '.jpg') <> False) | | (strstr($Filename, '.gif') <> False) | | (strstr($Filename, '.png') <> False)) { // Get info about this image. $ImageSize = GetImageSize($TheDirectory->path . $Filename); // Create a thumbnail, try to keep the proportions correct $ImageScale = $ImageSize[1] / $ImageSize[2]; $SourcePic = imagecreatefromjpeg ($TheDirectory->path . $Filename); $DestPic = imagecreate(100, 100 * $ImageScale); // Create a thumbnail from the image imagecopyresized($DestPic, $SourcePic 0, 0, 0, 0, 100, 100 * $ImageScale, $ImageSize[1], $ImageSize[2]); // Display the image imagejpeg($SourcePic); // Free up the resouces imagedestroy($SourcePic); imagedestroy($DestPic); } } $TheDirectory->close(); ?> Ok, so $ImageDir is the directory name I send the page, and as you can see I've only set it up to handle jpg files atm. So this isn't working, I just get a blank page what I need to know is... - How do I find out what version of gd I'm using? - Is there a way I can load a image, resize it then output it without using the gd functions? I would rather output the raw headers if possible but I'm not sure how, I'm not sure if my webhost is using the required version of gd, and I'd rather not have to hassle him for months to upgrade it. - Does anyone know any examples of thumbnail gallerys I can download?
PhpBB And Displaying Images
I need to add upload functionality of images to phpBB 1.4.4. I have decided to have the images upload directly into mysql as binary data. I have been succesful in adding upload code into phpBB to allow it to upload images. What I am having a problem with is displaying those uploaded images on the viewtopic.php page. I have taken a look at the tutorial on phpbuilder that talks about uploading and viewing binary data in mysql and I have followed the examples. here's the link if interested: http://www.phpbuilder.com/columns/florian19991014.php3 So basically this tutorial has the user create another file that will be called to grab and format (with proper header info -- image/gif) the image and send it back to the relevant page. So within my viewtopic page - where I want the image to appear I provide the following code. post_id is a parameter that tells getdata.php where the image field is located for that record. PHP Code:
Displaying Images In A Ratio
Instead of fixing the images height/width, can I have it show by a ratio of the original size? What I have is a large image and want to make a small "preview" of it (without creating another file), at the moment I just set it to 80x80pixels but the problem with this is if the large image isn't square it looks squashed. Is it possible to do it by a ratio?
Displaying GD Images Inline
I've created a script that allows someone to create an Image using variables that they define. After filling out the fields, they click preview. And it all works! ...except for 1 thing. I want to be able to generate the image with PHP and display it within the same page as the form (right below it), but when the user clicks preview, it shows nothing on the page, except the image. Code:
Displaying Integer Numbers As Images
I'm trying to display some images of digits 1-9 with respect to an int variable. i wrote a function to convert the int to string and did a ereg_replace to display the corresponding image. well seems like its not as easy as it seems. the function keeps replacing the wrong characters. function digitalize($average_user_review) { $average_user_review = ereg_replace("0", "<IMG SRC="images/digit0.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("1", "<IMG SRC="images/digit1.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("2", "<IMG SRC="images/digit2.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("3", "<IMG SRC="images/digit3.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("4", "<IMG SRC="images/digit4.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("5", "<IMG SRC="images/digit5.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("6", "<IMG SRC="images/digit6.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("7", "<IMG SRC="images/digit7.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("8", "<IMG SRC="images/digit8.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace("9", "<IMG SRC="images/digit9.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); $average_user_review = ereg_replace(".", "<IMG SRC="images/digit_point.gif" WIDTH="6" HEIGHT="18" ALT="" BORDER="0" VSPACE="7">", $average_user_review); return($average_user_review); }
Problem Displaying Images As Thumbnails
Im having problems displaying my images as thumbnails in a table. My code for producing the new width and height from the original image is as follows ************************************************** if ($ImagePath) { //$Image = WEB_ROOT . 'images/PupilTester/' . $ImagePath; $Image = 'images/PupilTester/' . $ImagePath; } else { $Image ='images/PupilTester/nopicture.bmp' } $size = getimagesize($image); $height = $size[1]; $width = $size[0]; if ($height > 150) { $height = 150; $percent = ($size[1] / $height); $width = ($size[0] / $percent); } else if ($width > 150) { $width = 150; $percent = ($size[0] / $width); $height = ($size[1] / $percent); } //echo "<img src"image/path/image.jpg" height="$height" width="$width" />"; ************************************************** ************ and in my table to display the thumbnail I have ************************************************** ************ <td rowspan="5" valign="top"><div align="left"><img src=<?php echo $Image; ?> width= <?php echo "$width"?> height= <?php echo "$height"?>> </div></td> </tr> ************************************************** ************** However the images are not showing at all. The cells of the table are blank. But if I use ********************************************* <td><img src=<?php echo $Image; ?>></td> </tr> ******************************************* The images show full size as normal. Can anyone see where Ive gone wrong
Displaying Inline Images Thru MySQL
I run a board that runs the Invision Board program. We are a photography forum, so lots of images get posted. IPB places all uploaded images and the GD-created thumbnails in one directory... right now there are over 40,000 files in there. We would like to archive the older images in a different place, so I devised a script that uses a coped table from the database with all rows without a image post deleted. The problem I have is that the database cross-references the original filenames with the new names they are given on the server. DSC_1000.JPG would get renames to "post-107-12382148343984.jpg" for instance. We would prefer to keep those "post" names for security, but would like to duplicate the method IPB uses to display the images with the file saving as the original (DSC) filename. Dissecting the IPB code returned nothing I can use nor figure out without a complete re-write of my script. So how would one go about opening a file depending on the query string, and place the real name of the file into the header dynamically? I have tried the following, and other derivations, but keep getting errors: PHP Code:
Making Images Smaller, And Displaying Them!
I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the images as I go, without writing them to disk on the server. Do I need to prepare all of the resized images before I display the data from the select (which is put into an array by php). How can I display a resized image in a table, without writing it to disk first? I could get around this problem by creating smaller images in the windows app (non web) but I cannot find anything to do this. If you know of a dll or ocx etc that I could use,
Displaying Images In Php Created Emails
I have created a php script that sends html emails and attachements. I couldnt figure out how to send an html email so that when the reciever opens his email, the images are displayed in the table and not as seperate attachements. I have used both activemaillib and php's mail function The only way I succeeded was using hyperlinks in the table that fetches the email from a server, but some people download emails, close their internet connections and then read their emails.
Problem Displaying Images With Php And Mysql
I am uploading images to a server and saving the script location to a mysql database. It is loading into the server. When I call it with PHP it doesn't show up. When I try to access it directly I get a an error stating that this directory is restricted without an index file. I added an index file, but it made no difference. The directory is set to 777. Also, I manually changed the chmod on the image to 777 and now I am getting a "page not found" error. here is the upload code:
Displaying Dynamicly Created Images
I'm working on the registration page of my website, and am building in a system where the user has to read something out of a dynamically created image. I can create the image just fine, but how do I get it to display in a web page? Code:
Uploading And Displaying Multiple Images
I am building a website where people can post jobs that need to be done and have laborers bid on them.... Im done with pretty much everything on the site but im having a hard time figuring out how to upload and display multiple images for each job.... I am able to upload and display one image but i can upload multiple images.... Everytime I try to do so, It only displays multiple copies of the first image that i upload. Code:
Java Script Code For Displaying Images In PHP?
I have this java script code that updates the "img src" tag of my images on the page... <script Language="JavaScript"> function showupdate(photo){ document['bigPhoto'].src = photo;} </script> Now, is there any way to write this code in PHP (not in Java Script), since I want to save that "photo" variable for later use and manipulation... ???
Displaying A Varying Number Of Images.. In Tables?!
I'm building a news system. I have a page to display all posts made to category=$id, simple enough, now I wanna make an index page that looks up all the categories from the news_topics table, displays their name, a link to their page, and the image assigned to that category. Here's the catch: I wanna put this in a table as the images are only a few hundred pixels wide, so a flat list of each image would be boring and inefficient. The thing is, we may add/remove news categories over time, so how can I deal with this? Would it really be easier to manually make this in HTML and change it as/when we make modifications to the topics table?
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...
Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them. An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.
Stamps/inserts Small Images (logos) Onto Larger Images.
It may be called image stamping or water marking but im not sure. Basically i want a script that prints/stamps a smaller image onto a larger one, the smaller mage being a logo. This will make it harder for people to steal my pictures as they will have my logo on them. An example of this is with ebay, when you submit a picture of the item your selling ebay will printe a small logo in the bottom right corner of the picture. Could anyone suggest a script for this, just a simple one then i can mess around with it and make it better.
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:
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.
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.
|