keymasterviriya1150

Untitled

May 5th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.20 KB | None | 0 0
  1. <script language="JavaScript">
  2.     function confirmDelete(){return confirm('Are you sure you want to delete this?');}
  3.  
  4. </script>
  5. <?php
  6.     $con=mysqli_connect("localhost","root","","testorder");
  7.     /*if($con!=null)
  8.         echo"Sucess";*/
  9.     $result=mysqli_query($con,"SELECT * FROM orders WHERE IDTYPE>0 " );
  10.     if(!$result)
  11.         die("connot");
  12.     $data=array("ID","IDType","Type","Price","No","PriceResult","Delete");
  13.     echo"<center>";
  14.     echo"<h1><u>DELETE</u></h1>";
  15.     echo"<table border=1>";
  16.         echo"<tr>";
  17.             for($i=0; $i<count($data) ; $i++)
  18.                 echo"<td>".$data[$i]."</td>";  
  19.     echo"</tr>";   
  20.     while($row=mysqli_fetch_array($result,MYSQLI_NUM))
  21.     {
  22.         echo '<form name="frmDelete'.$row[0].'" method="post" action="d.php">'."\n";
  23.         echo'<tr>';
  24.         for($i =0; $i<6 ;$i++)
  25.             echo "<td>".$row[$i]."</td>";
  26.        
  27.        
  28.         echo '<input type="hidden" name="id" value="'.$row[0].'">';
  29.             echo '<td><input type="submit" value="Delete" onClick="return confirmDelete();" ></td>';
  30.         echo'</form>';
  31.    
  32.         echo'</form>';
  33.         echo '<tr/>';
  34.     }
  35.  
  36.  
  37.  
  38.    
  39.    
  40. echo"</table>";
  41.     $result=mysqli_close($con);
  42.     echo"<br/><input  type='button'  onClick='window.history.back()' value='Back'>";
  43. echo"</center>";
  44.  
  45.  
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment