can I use a link on a web page to call a function?
example
Code:
<?php
function test($file,$path){
//force download an mp3 file
}
?>
<html>
<head>
<title>test</title>
</head>
<body>
<a href="<?php test(Rom1_1.mp3, Romans/Rom1_1.mp3); ?>">click here</a>
</body>
</htm>
basically I just want to force download an MP3 file. force download code below
Code:
<?php
$mp3Name ="Rom1_1.mp3";
$filename = "Romans/Rom1_1.mp3";
header("Content-Length: " . filesize($filename));
header('Content-Type: audio/mpeg');
header("Content-Disposition: attachment; filename= $mp3Name");
readfile($filename);
?>
I've been trying without success! what am I missing here? or is this possible?