Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67411

Php display image even if it was deleted

$
0
0

I am new on php and I have some very weird situation here. Basically, I wanted to display an image called Default.jpg. After that, I felt like this image is not suitable and decided to change it inside my picture folder. But, when I run my code again, it display back the first image instead of the one that I have changed. I deleted the image to try and test but, surprisingly, the image is still able to display as the first image. Here is my code. I also check whether if the file exist and it display as file deleted.

<?php
    require_once('UserClass.php');
    session_start();
    //require_once('dbconfig/config.php');
    require_once('dbconfig/db_connection.php');

    //phpinfo();
?>
<!DOCTYPE html>
<html>
  <head>
    <title>Homepage</title>
  </head>
  <body>
    <h2>Homepage</h2>
    <img src = "Default.jpg" id = "Avatar" />

    <?php
        $file = "Default.jpg";
        if (file_exists($file)) {
            echo ("file exist");
        } else {
            echo ("file deleted");
        }   
    ?>
  </body>
</html>

Viewing all articles
Browse latest Browse all 67411

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>