Cant display pictures

Hello ,

I have a problem with an exercise from college and can’t figure out where my mistake is because I am sure
it’s in the syntax.
In the example given to us, I was able to get the pictures displayed.

for ($i=0;$i<$num_results;$i++)
 {
$row=mysql_fetch_array($result);
extract($row);
echo "<p>Car id:",$carid;
echo "<br>";
echo "<img src='photos/".$photo.".png'>";
echo "<br>";
echo "<p>";
}

However in the task where we have to transform the page from a carorder form into a boatorder form. The boat order form is not displaying my images.

for ($i=0;$i<$num_results;$i++)
 {
$row=mysql_fetch_array($result);
extract($row);
echo "<p>Stock No:",$stockno;
echo "<br>";
echo "Make: ",$make;
echo "<br>";
echo "<img src='./resources/images/",$photo.".png'>";
echo "<br>";
echo "<p>";
}

Maybe some context:
In the Mock-exercise, we were given the code and the scenario, that a dealership wants to have a login page and order form page and we had to get it working ( i managed that, except something minor).
Anyway for the exercise alone we have to transform the login and orderpage etc. from a car dealer to a boat manufacturer, so the pictures are in a different folder and I cannot figure out why it won’t display my pictures.
The tree in the folders are index.html is on same level as resource folder and images is a child of resources.
Hope somebody can help.
Kind regards
Lukas

do you want to tell me?

Hello,

Example exercise:

echo "<img src='photos/".$photo.".png'>";

Task:

echo "<img src='./resources/images/",$photo.".png'>";

Hey bud,

Sorry, I can’t see any difference in the code you wrote .
The images in the resources/images folder are not displayed.

kind regards
Lukas

Hi,
not sure what you mean?

Hey,

There’s no difference because I didn’t change anything :slight_smile:

I’m pointing out the difference between the mock-example, and what you produced.

The reason the image isn’t showing is there, but you need to carefully review the code.

Hi Ghost,

I have changed the comma before the $photo to a dot and tried a different file formformat to .jpg (I changed my images format too) but that didn’t help either.
They still won’t display, I can send you the link to my college FTP and you can have a look.
But not sure if I’m allowed to post links or such here.
Kind regards
Lukas

No I don’t think you should be giving anyone access to your college’s FTP :wink:

If you corrected the code and the image still doesn’t show, it means that the path to that image is not correct. The image extension won’t change that.

I have no idea what the project structure looks like exactly, so it’s hard to say.

Not access the FTP server, I mean the link where you can watch the webpage.
It’s okay, I’ll figure it out.
I thank you very much for your time and effort.

Kind regards
Lukas