PHP url params and return to calling page
<p>My php script is supposed to download a .zip file, and increment a counter.
In the code below, the parameters passed in on the URL are not being recognized, so the  line to download a file doesn't do anything, and if the file download doesn't work, the count loops endlessly, incrementing the count. My provider is using PHP V5.2.</p>

<p>I'd like for the passed parms to work, but I can live with hardcoding "myapp.zip" in the  tag.</p>

<p>I need to return to the page that called count.php after it's work is done.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;?php
//$Down=$_GET['Down'];
$Down=$_Post['Down'];
echo "File:" . $Down;?&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;

  &lt;meta content="en-us" http-equiv="Content-Language" /&gt;
  &lt;meta content="text/html; charset=utf-8" http-equiv="Content-Type" /&gt;
  &lt;!--meta http-equiv="refresh" content="0;url=&lt;?php echo $Down;?&gt;"/--&gt;
  &lt;meta http-equiv="refresh" content="0;url=MyApp.zip"/&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;?php
   $filePath = 'count.txt';
   // If file exists, read current count from it, otherwise, initialize it to 0
   $count = file_exists($filePath) ? file_get_contents($filePath) : 0;
   // Increment the count and overwrite the file, writing the new value&lt;br /&gt;
   file_put_contents($filePath, ++$count);
   // Display current download count
   //echo "Downloads:" . $count;
   //header("Location: $r.htm");
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>It's called from r.htm like this: </p>

<pre><code>&lt;form method="post" action="count.php?Down=myapp.zip" style="text-align: center"&gt;
&lt;input type="submit" value="Download MyApp"&gt;
&lt;/form&gt;
</code></pre>
