I need some help with the IF command...


Posted on 16th Feb 2014 07:03 pm by admin

I have a large number of images in one section of my website with the .jpg format. I'm adding a bunch of new images thanks to a new camera, but in using Picasa to bulk export smaller images sizes, they are all exported with .JPG.

These are head shots (mug shots) for basketball player profile pages. It's just supposed to be one photo, but the .jpg code isn't printing the .JPG files, which is obvious, so I added a line to print the newly exported .JPG files. The problem is I'm getting two items printed, the image and an image holder.

How do I code it to basically say.... "if *this* file type exists....echo *this* file....else if *this* file type exists....echo *this*.

Here is the code I'm using:

echo '<div><img src="/wp-content/uploads/' . $line['nameLast'] . $line['nameFirst'] . '.jpg"></div>';
echo '<div><img src="/wp-content/uploads/' . $line['nameLast'] . $line['nameFirst'] . '.JPG"></div>';

No comments posted yet

Your Answer:

Login to answer
225 Like 9 Dislike
Previous forums Next forums
Other forums

Staff Induction System - No idea where to go from here!!!
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

Form submissing with PHP and JQuery/Ajax
I have searched everywhere, but cannot find a solution for this... I have worked all day trying to g

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

explode() function problem maybe
Hi I'm having trouble searching my database. When I type two words in the search field it only searc

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Hotlinking Picasa as the image folder of a website
Hi there PHP freaks, I would like to create a private album in Picasa to use it as the image folder

How to kill asynchronous postback / current postback?
Hi,here is my problem:I have a web site with many pages of which some may take time to process resul

Help: problem with Headers to download PDF file
Hi,

I'm trying to implement a script where when a user clicks a link he gets a PDF file to op

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash