Vous n'êtes pas identifié(e).
Pages :: 1
Bonjour,
Quand je clique sur une icone, je voudrais que le fichier soit telecharge, il retourne cette erreur:
data is null
[Break On This Error]$(".downloadCounter").html(data.downloadCounterCheck);
page1.php:
page2.php:
function forcerTelechargement($nom, $situation, $poids)
{
header('Content-Type: application/octet-stream');
header('Content-Length: '. $poids);
header('Content-disposition: attachment; filename='. $nom);
header('Pragma: no-cache');
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Expires: 0');
readfile($situation);
exit();
}
$return_arr = array();
$rub = $_POST['rub'];
$srub = $_POST['srub'];
$cat = $_POST['cat'];
$scat = $_POST['scat'];
$menu = $_POST['menu'];
$type = intval(abs($_POST['type']));
$num = intval(abs($_POST['num']));
$date_posted = time();
$sel = 'SELECT .... LIMIT 1';
$reqs = $connexion->query($sel);
$results = $reqs->fetchAll();
if(empty($results))
{
echo 'cannot add to DB';
}
else
{
foreach($results as $kd=>$vd)
{
$downloaded = $vd['downloaded'];
}
$downloadCounterCheck = $downloaded + 1;
$up = 'UPDATE ....';
$requp = $connexion->query($up);
$path2mp3 = '[url]http://www.site.com/file.mp3[/url]';
}
$return_arr["downloadCounterCheck"] = $downloadCounterCheck;
forcerTelechargement($domainSite.'_'.$scat.$soura_num.'.mp3', $path2mp3, 1000000);
echo json_encode($return_arr);
?>
index.php:
merci
Hors ligne
est ce qu'il y q quelqu'un qui a une idee sur ce bug?
Hors ligne
Pages :: 1