D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
balhit1357
/
balhit.ac.in
/
OldSite
/
Filename :
tc_dpwnload_action.php
back
Copy
<?php include "admin/include/z_db.php"; $scholar = $_POST['sch']; $fyear = $_POST['fyear']; //$filename = mysql_result(mysql_query("SELECT file FROM tc_file WHERE fyear='$fyear' AND scholar='$scholar'"),0,0); $sql11="SELECT file FROM tc_file WHERE fyear='$fyear' AND scholar='$scholar'"; $result1=mysqli_query($link,$sql11); $fieldinfo=mysqli_fetch_array($result1); $filename=$fieldinfo[0]; if($filename != ''){ // define the path to your download folder plus assign the file name $path ='admin/'.$filename; //echo "<a href='$path'>Download This file</a>"; // check that file exists and is readable ?> <?php ?> <script> //alert("File does not exist!!"); window.location.href="tcdownload_pdf.php?pd=<?php echo $path; ?>"; </script> <?php } else { ?> <script> alert("File does not exist!!"); window.location.href="tc_download.php"; </script> <?php } ?>