Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Why dynamically generated image tag is not displaying image using php

I am trying to display image using PHP dynamically generated HTML response My problem is that I am getting ERROR 404 resource not found in browser. Here is my php response code.

$Preview_img_source = $PreviewImagePath . $Preview_img_fileName;

    $responseLine1 = '<section class="ArticleSection1">';
            $responseLine2 = '<div class="imageDivArticleSection1">';
            $responseLine3 = '<img src=" ' . $Preview_img_source . ' "></img>';
            $responseLine4 = '</div>';
            $responseLine5 = '<div class="HeadingDiv">';
            $responseLine6 = '<h1>' . $Article_Title . '</h1>';
            $responseLine7 = '</div>';
            $responseLine8 = '<div class="PreviewTextDiv">';
            $responseLine9 = '<p>' . $Article_PreviewText . '</p>';
            $responseLine10 = '</div>';
            $responseLine11 = '<div class="OptionsDiv">';
            $responseLine12 = '<button>Read more</button>';
            $responseLine13 = '<span class="TagSpan"><a class="TagLink"> Dev ' . $Tag1 . '</a></span>';
            $responseLine14 = '<span class="TagSpan"><a class="TagLink"> Dev ' . $Tag2 . '</a></span>';
            $responseLine15 = '<span class="TagSpan"><a class="TagLink"> Dev ' . $Tag3 . '</a></span>';
            $responseLine16 = '<span class="TagSpan"><a class="TagLink"> Dev ' . $Tag4 . '</a></span>';
            $responseLine17 = '</div>';
            $responseLine18 = '</section>';

            $response = $responseLine1 . $responseLine2 . $responseLine3 . $responseLine4 . $responseLine5 . $responseLine6 . $responseLine7 . $responseLine8 . $responseLine9 . $responseLine10
            . $responseLine11 . $responseLine12 . $responseLine13 . $responseLine14 . $responseLine15 . $responseLine16 . $responseLine17 . $responseLine18;

            echo($response); 

I am not able to figure out where is the defect...

I am getting this error in browser:

Not Found

The requested URL /Test files/InfiniteScroll/Article/testTextFiles/aaaawqqqqwww.html was not found on this server.

NOTE: please don't mark my question Duplicate.

the same thing is happening with .html files when I am trying to display them in iframes.

Comments