QUOTE(CharlesEF @ Mar 16 2020, 11:35 PM)
I didn't see this post before but here goes. In the PHP code $file2 is useless and should be removed, the entire line, because of the way href works it will NEVER work. You want to insert $file into the href attribute, like this:
CODE
<a href="<?php echo "/{$file}";?>" download>DOWNLOAD</a>
Notice the '/' at the start of the href. That represents the home directory. This means your download directory is located under your public_html directory.
Hope this helps, post back if you have any other questions.
Charles, I need some more help. I've changed to using a button.jpg and I'm getting a syntax error on the button. Here's the code as currently wriiten:
CODE
<?php
$files = array();
$files = glob('download/*.iso');
$file = $files[count($files) - 1];
?>
<div id="download" class="filter">
<div class="container">
<div class="row">
<div class="stylized">
<h1>FoxClone Download Page</h1>
<h3>Get the latest version of FoxClone </h3>
<a href="<?php echo "/{$file}";?>" <img src="images/button_get-the-app.png" alt="" width="104" height="40"></a>
I'd also like to know how I can check the members of the array(). I've heard about print_r($myarray) and var_dump($myarray) but have no idea how to insert it into my code so I can verify that the php code is working.
EDIT: I ran the code on my hosts server and I'm getting a 404 error with this information:
"This www.foxclone.com page can’t be found
No webpage was found for the web address:
https://www.foxclone.com/<?php%20echoHTTP ERROR 404"
I get the same error on my apache server. It appears that the "<?php echo "/{$file}";?>" isn't being translated. Is there a way to convert that to a standard variable before using it in the button?
Thanks again for all your help,
Larry