I am trying to do something really simple with php but I can not find where I have the mistake! So, I want to echo an image like this (part of the code):
$file_path[0] = "/Applications/MAMP/htdocs/php_test/image_archive/".$last_file[0];
echo $file_path[0];
echo "<br>";
echo "<img src=\".$file_path[0].\" alt=\"error\">";
I must have some kind of error when I echo the img tag but I can not find it. Any help would be appreciated.
<div class="content">
<h1> Map</h1>
<?php
include '/Applications/MAMP/htdocs/php_test/web_application_functions/last_file.php';
$last_file = last_file();
$file_path[0] = "/Applications/MAMP/htdocs/php_test/image_archive/".$last_file[0];
echo $file_path[0];
echo "<br>";
echo '<img src="' . $file_path[0] . '" alt="error">';
?>
<!-- end .content --></div>
You should use a path either relative to the server root, or the current file.