PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello, I'm a total rookie at this. I have a script which generates a random image from a file ( of images uploaded by my forum users) . It works fine except one user uploads a .png image with all of his posts and its' showing up too frequently. I thought I had the script pulling just jpg and jpeg images but for some reason this .png shows up. I'm trying to modify the code to block or at least limit this .png image from showing up. The file is also 541 bytes(?) if that helps. My code is below. Please let me know how I should modify this...thanks!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
$img_info = getimagesize($image);
if($img_info[2] != 2)
{
//warn that it must be jpg only
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
tonto68, please edit your original message to conform with forum rules. You should have a subject that describes your problem and use php bb tags when posting code.