1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<?php
session_start();
$ID="NOWAY";
$Pass="NOWAY";
if(isset($_SESSION['nom']))
{
$ID=$_SESSION['nom'];
if(isset($_SESSION['pass']))
{
$Pass=$_SESSION['pass'];
if(!empty($_GET["Ref"]))
{
$Ref=$_GET["Ref"];
$conn=mysql_connect("localhost",$ID,$Pass);
if($connection)
{
if(mysql_select_db("miramer"))
{
$sqlStatement = "SELECT Lien_Mes FROM miramer.t_mesures WHERE (Ref_Mes='{$Ref}')";
$result = mysql_query($sqlStatement);
if(mysql_num_rows($result)!=0)
{
$row="data/"+mysql_fetch_object($res);
header("Content-type: application/force-download");
header("Content-Length: ".filesize($row));
header("Content-Disposition: attachment; filename=".basename($row));
readfile($row);
}
}
}
}
}
}
?> |