Jump to content

Intersysop2

New Members
  • Posts

    3
  • Joined

  • Last visited

Intersysop2's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can i amend or convert the string to a web address ?
  2. is suppose to do some thing in current page, the $filename = substr($file, 0, -4); is just subtracting the .pdf extension from the name so i can use it for the button title
  3. Hello i am trying to embed a collection of pdf in a in a web page, i got the name to work but when i click on it, i get a Blank square, does anyone see anything wrong with my code ? Thanks ! $dir = "C:\inetpub\wwwroot\Docs\Manuals\Honda"; // Change this to the directory containing the PDF files $files = scandir($dir); foreach ($files as $file) { if (substr($file, -4) == ".pdf") { $filename = substr($file, 0, -4); echo "<button class=\"collapsible\">$filename</button>"; echo "<div class=\"content\">"; echo "<embed src=\"$dir/$file\" width=\"100%\" height=\"500\">"; echo "</div>"; } } ?> <script> var coll = document.getElementsByClassName("collapsible"); var i; for (i = 0; i < coll.length; i++) { coll.addEventListener("click", function() { this.classList.toggle("active"); var content = this.nextElementSibling; if (content.style.display === "block") { content.style.display = "none"; } else { content.style.display = "block"; } }); } </script>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.