This function enables every object's display needed to display an image and it's title, caption, etc in a modal. I need the argument directory in order to make an mysqli request to display the title, caption, etc.
function imageModal(directory)
{
  document.getElementById("modal").style.display = "block";
  document.getElementById("imageImg").src = directory;
  document.getElementById("image").style.display = "flex";
  document.getElementById("imageDirectory") = directory;
}
So, with this container I have I want to pass the src given to imageImg to a php variable that I can use to make this mysqli request using the image's directory.
<!-- Picture Container -->
<article id="image" method="post" name="form">
  <section id="imageContainer">
    <img id="imageImg">
  </section>
  <section id="imageInformationContainer">
    <p style="color: white;"> <?php echo $imageDirectory; ?> </p>
  </section>
</article>
 
     
    