keymasterviriya1150

Untitled

May 5th, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <script language="JavaScript">
  2.     function confirmEdit(){return confirm('Are you sure you want to Edit 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 list WHERE IDTYPE>0 " );
  10.     if(!$result)
  11.         die("connot");
  12.     $data=array("ID","IDType","Type","Price","EDIT");
  13.     echo"<center>";
  14.     echo"<h1><u>EDIT</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="frmedit'.$row[0].'" method="post" action="formedit.php">'."\n";
  23.         echo'<tr>';
  24.         for($i =0; $i<4 ;$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="Edit" onClick="return confirmEdit();" ></td>';
  30.         echo'</form>';
  31.    
  32.         echo'</form>';
  33.         echo '<tr/>';
  34.    
  35.     }
  36.  
  37.  
  38.  
  39.    
  40.    
  41. echo"</table>";
  42.     $result=mysqli_close($con);
  43.     echo"<br/><input  type='button'  onClick='window.history.back()' value='Back'>";
  44. echo"</center>";
  45.  
  46.  
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment