hello to all
i have the php function for force download which also update the total number of downloads to MYSQL DB, the problem is i want to rename the orignal file name to new name, for example orignal name is file.mp3 (on the server) must be change to file-blah-blah.mp3 (when user want to download). here is my function below. i will realy love if someone solved my problem $sql = "select * from table where tableID = $tableId";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
$downloads = $myrow["downloads"] + 1;
} while ($myrow = mysql_fetch_array($result));
}
$sql = "update wallpaper set downloads = $downloads where tableID = $tableID";
$result = mysql_query($sql ,$db);
$newurl = "images/" . $size . "/" . $wallpaperid . ".jpg";
Header("Location: $newurl");