code for php4
Posted: Wed Feb 06, 2008 6:09 am
This code below doesnt work with php 4 how to convert to work with php4 also the Error at the 1 script and echo at the second doesnt work?
$a2f = "www.mysite.com_";
also how to add $a2f to this second script below which work with php 4?
Code: Select all
function checkfile($link, $name) {
if (@file_get_contents($link, NULL, NULL, NULL, "50000")) {
header("Content-type: audio/mpeg;\r\n");
$head = "Content-Disposition: attachment; filename=\"$name\";\r\n";
header($head);
readfile($link);
}else{
die($lang[Error]);
}
}
$name = $a2f . $_GET[name];
$link = "http://www.downloaded.com/files/" . $_GET['file'] . "/?id=" . $_GET['idx'];
checkfile($link, $name);also how to add $a2f to this second script below which work with php 4?
Code: Select all
<?php
if(!@fopen("http://www.downloaded.com/Afiles/" . $_GET['file'], r)) {
echo "Sorry, The file has been removed.";
}else{
header("Location: http://www.downloaded.com/files/" . $_GET['file'] . "/?id=" . $_GET['id']);
}
?>