I have trouble executing my PHP code when i open my HTML file

Viewed 26

I have trouble executing this php code, which is supposed picks a random picutre in a folder i have. I'm running my html code on a local hosted server with XAMPP, which, as far i can read, should support PHP. I tried running the code through tiiny.host as well, but i dosen't seem like the code is executing there either. The directory works but putting in manual numbers such as /pics/nftlist/10.png

 <div class="APE">
    <img src="/pics/nftlist/<?php $random = rand(7,207); echo($random); ?>.png" height="90">
 </div>

Any idea on what to do? Thanks in advance!

Web result

1 Answers

Create a file called test.php and paste the following:

<?php phpinfo(); ?>

If it does not work your PHP is not configured.

Related