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.

Did you know?Explore Trending and Topic pages for more stories like this.
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

redirect standard error and assert (how to?)
How do you redirect standard error and assert?

---

(Why? I am creating an web app and

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

Estimations and Effort
HI Gurus,

Would like to know whether SAP have a provision for carrying out the Project es

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

PHP and MySQL on intranet?
Is it possible to use both these on an intranet network?

session variables not working anymore
hello,
i use sessions to handle authentication within my site. my host has been changing a lot of

Internal class functions don't seem to get executed.
Hi. Can someone please put me out of my misery on this. I don't write much PHP and this has me baffl

Multidimensional Array into an Html table, help!
Hello all, I am new to HTML/PHP so any help would be great.

I have a multidimensional array f

Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like

Giving the below syntax error
Dear Experts,

I have used 2 buttons in gui status as display and cjhange.When the user wi

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