<form name="form2" action="test_mix.php" method="POST"> <table id="displaytable" width="400" border="0" align="center" cellpadding="0" cellspacing="1" style="vertical-align:middle;"> <tr> <td><table width="421" height="279" border="0" cellpadding="3" cellspacing="1"> <tr> <td width="29" rowspan="5" style="vertical-align:middle;"> <?php echo "<input type=checkbox name=del[] id=del value=$rows[id]>"; ?> </td> </tr> <tr> <td width="83">Date</td> <td width="6">:</td> <td width="276"><?php echo $rows['date']; ?></td> </tr> <tr> <td valign="top">Title</td> <td valign="top">:</td> <td><?php echo $rows['title']; ?></td> </tr> <tr> <tr> <td valign="top">News</td> <td valign="top">:</td> <td><?php echo $rows['news']; ?></td> </tr> <tr> <td height="55" valign="top" style="vertical-align:middle;"></td> <td valign="top"><?php echo "<input type=checkbox id=pdf value=$rows[id] onclick=Button1() name=pdf[];/>" ?> <!--<input type="submit" name=pdf[] id=pdf value=$rows[id] formtarget="_blank" src="Untitled-7.php" /> --> <!--<a href="javascript:void(0);"<?php /*?> <?php name=pdf[]; id=pdf; value=$row[id];?><?php */?> onclick="javascipt:window.open('Untitled-7.php');" class="popup">Clic to open.</a>--> <!--<a href="Untitled-7.php" target="_blank" >Read More</a>--></td> <td height="200" width="6" style="overflow:auto;">:</td> <?php /*?><?php echo $rows['file']; ?><?php */?> </tr> </table></td> </tr> </table> <?php } mysql_close(); //close database ?> <!--<input type="submit" name="justdel" value="Delete !!" id="justdel" style="float:right;">--> <INPUT type="button" value="Delete !!" name=justdel id="justdel" onclick="return OnButton2();" style="float:right;"> </form>
<?php //delete.php include('update_config.inc'); if($_POST['del']=""){ //if(isset($_POST['justdel'])){ //if(($_POST['del']) = "";){ $id = $_POST['del']; $count = count($id); //counting how many rows (from checkbox) to delete for ($i=0; $i<$count; $i++) { $sql = mysql_query("delete from $tbl_name where id=$id[$i]") or die(mysql_error()); } if ($sql) { header("location:adminupdates.php"); } } else if(($_POST['pdf']="")){ $id = $_POST['pdf']; $count = count($id); //counting how many rows (from checkbox) to delete //if($_POST['pdf']) $gotten = @mysql_query("select file from $tbl_name where id=$count limit 1"); $row = @mysql_fetch_assoc($gotten); $bytes = $row['file'] or die(mysql_error()); //header("Content-Description: PHP Generated Data"); header("Content-transfer-encoding: binary"); header("Content-type: application/pdf"); //header('Content-disposition: attachment; filename="thing.pdf"'); //print $bytes; print $bytes; } else{echo "in three";} //} ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)