(1)<?php
$coursename=$_POST['coursename'];
$semester=$_POST['semester'];
echo '<h3>';
echo '<table border=0>';
echo '<tr> <td>';
echo "CourseName =".$coursename;
echo '</td> <td> </td>';
echo '<td>';
echo "Semester =".$semester;
echo '</td></tr>';
echo '</table>';
echo '</h3>';
$con=mysql_connect("localhost","root","");
mysql_select_db("itexam",$con);
$sql="select * from notes where coursename='$coursename' AND semester='$semester' order by subject";
$result=mysql_query($sql) or die(mysql_error());
echo '<h4>';
echo '<table border=0>';
echo '<tr><td>id</td><td><h2>Subject Name </h2></td><td> </td><td><h2>Unit </h2></td><td> </td> <td> <h2>Download Link</h2></td></tr>';
;
echo '<form action="downloadall.php" method=post>';
while($row=mysql_fetch_array($result))
{
echo ' <tr><td><input type=checkbox name=data[] value="'.$row['id'].'"></td><td>"'.$row['subject'].'" </td><td> </td><td>"'.$row['unit'].'" </td><td> </td>
<td>
<button ><a href=../proudct_images/download1.php?download_file="'.$row['file'].'">
Download file</a></button> </td></tr>';
}
echo '</table>';
echo '
<input type=submit name=submit value=Download-all>
</form>';
?>
(2)
<?php
//$data=$_POST['data'];
//$test=implode(',',$data);
//echo $test;
include("connect.php");
//$sql="select file from notes where id IN('$test')";
$ids=$_POST['data'];
$num_list=implode(',', $ids);
echo $sql = "select * FROM notes WHERE id IN($num_list)";
$result=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
echo '<a href=../proudct_images/download1.php?download_file="'.$row['file'].'">
Download file</a>';
}
?>
$coursename=$_POST['coursename'];
$semester=$_POST['semester'];
echo '<h3>';
echo '<table border=0>';
echo '<tr> <td>';
echo "CourseName =".$coursename;
echo '</td> <td> </td>';
echo '<td>';
echo "Semester =".$semester;
echo '</td></tr>';
echo '</table>';
echo '</h3>';
$con=mysql_connect("localhost","root","");
mysql_select_db("itexam",$con);
$sql="select * from notes where coursename='$coursename' AND semester='$semester' order by subject";
$result=mysql_query($sql) or die(mysql_error());
echo '<h4>';
echo '<table border=0>';
echo '<tr><td>id</td><td><h2>Subject Name </h2></td><td> </td><td><h2>Unit </h2></td><td> </td> <td> <h2>Download Link</h2></td></tr>';
;
echo '<form action="downloadall.php" method=post>';
while($row=mysql_fetch_array($result))
{
echo ' <tr><td><input type=checkbox name=data[] value="'.$row['id'].'"></td><td>"'.$row['subject'].'" </td><td> </td><td>"'.$row['unit'].'" </td><td> </td>
<td>
<button ><a href=../proudct_images/download1.php?download_file="'.$row['file'].'">
Download file</a></button> </td></tr>';
}
echo '</table>';
echo '
<input type=submit name=submit value=Download-all>
</form>';
?>
(2)
<?php
//$data=$_POST['data'];
//$test=implode(',',$data);
//echo $test;
include("connect.php");
//$sql="select file from notes where id IN('$test')";
$ids=$_POST['data'];
$num_list=implode(',', $ids);
echo $sql = "select * FROM notes WHERE id IN($num_list)";
$result=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
echo '<a href=../proudct_images/download1.php?download_file="'.$row['file'].'">
Download file</a>';
}
?>
No comments:
Post a Comment