How do you get PHP to start a download of a file (lets say a .zip)?
Here is my file:
echo "Error: Could not connect to database. Please Contact Admin";
$result = mysql_query("select * from files WHERE id='$id' AND status='0'");
$row = mysql_fetch_array($result);
echo "Error: Could not find file in database. Please Contact Admin";
$file = stripslashes($row['url']);
$downloads = $row['downloads']+1;
$fp = fopen($file, "r");
echo "Error: Could not download file. Please Contact Admin";
$query = "update files set downloads='".$downloads."' where id='".$id."'";
$result = mysql_query($query);
echo "You may close this window.";
The program finds the URL (Ex: http://www.atlanticrail.com/files/ac0001.zip
) and then I need it to start a download.
I don't get any errors, just the "You may close this window" message. Meaning it opened the file.