[EdLUG] Help 11

Tai Kedzierski dch.tai at gmail.com
Fri May 15 19:16:47 UTC 2020


It might be beneficial to start a thread somewhere like StackOverflow or
Reddit for this...

I'm not sure it's particularly a good format to send programming support
threads to a mail-all list...!


===
Tai Kedzierski
Linux Operations and Deployments Engineer


I use LibreOffice <https://www.libreoffice.org/> , a free,
Freedom-respecting replacement for MS Office

*Open Source Free Software is a matter of liberty, not price.*
https://www.fsf.org/about/what-is-free-software



On Fri, 15 May 2020 at 20:14, Andrew Ramage <a.ramage at blueyonder.co.uk>
wrote:

> I don't know if this will work ...
>
> I have changed the form action call to a seperate file called
> "loginmusic.php" which checks the password and if it is correct assigns
> "OK" to $pwd.  If it is correct, the directory will be printed.
>
> index.php
>
> <script>
> function dirmusic() {
>      $musicdir = array(); // declare and initialise an array like this
>      $dir = "Music/";
>
>      if ($_POST($pwd) == "OK")
>      {
>          if (is_dir($dir))
>          {
>                  if  ($dh = opendir($dir))
>                     {
>                          $x = document.getElementById("demo").innerHTML;
>                          document.getElementById("demo").innerHTML = $x
> . $file . "<br>";
>                   {
>                      while (($file = readdir($dh)) !== false)
>                          array_push($musicdir, $file); // array_push
> alters the array in place
>                      }
>                      closedir($dh);
>                  }
>          }
>      }
>      else
>      {
>           alert("You are not allowed to download music.");
>      };
> }
> </script>
>
>
> --
> EdLUG mailing list
> EdLUG at lists.edlug.org.uk
> https://lists.edlug.org.uk/mailman/listinfo/edlug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.edlug.org.uk/pipermail/edlug/attachments/20200515/524c62b4/attachment.html>


More information about the EdLUG mailing list