0

I am having trouble with something that I know is probably really simple:

I have a bunch of photos in a profile image folder. I want to call the image based on the id of the folder like this main-$id.jpg. I need to know the PHP that can do that...

Thank You

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by Ender330
0

The images are all in a folder. When they are uploaded by a member it creates a small version and large version in the same folder main-id and mainl-id. id is equal to a number

0

You can do that but i will advice you to store your paths in DB.
As folder grows, sorting becomes a very big issue.

1. You must have a very logical naming for your images. eg. the big image named big2233.png and the small one sm2233.png. ID.

2.In this case you can go to the image folder and request for the images but you still must have something that connects this image to a USER/PERSON.


Give some more info ok?.
post your code. ;)

0
<?php
            if (file_exists("profileimages/main-$id.jpg")) {
                echo "<img src=\"profileimages/mainl-$id.jpg\">";
            } else {
                echo "<img src=\"images/default.png\">";
            }
            ?>

Ok if i am correct this code is used to pull the image file from a folder
and display it as the main profile image. This works fine. So how can I make
this work for me to post the thumb into the members account page. Or am I way
off with this code?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.