SHARE
TWEET

Untitled

a guest Jun 19th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2.     <head></head>
  3.    
  4.     <body>
  5.     <?php
  6.         $naam = $_GET["id"];
  7.        
  8.         $link = mysql_connect("localhost","root","usbw");
  9.         mysql_select_db ("mydb",$link);
  10.         $result = mysql_query("SELECT * FROM Telefoonnummers WHERE Naam = '$naam'",$link);
  11.         $row = mysql_fetch_assoc($result);
  12.        
  13.         $name = $row["Naam"];
  14.         $telnr = $row["Telefoonnummer"];
  15.         $mobiel = $row["Mobiel"];
  16.     ?>
  17.    
  18.     <table>
  19.     <form action = 'admin.php' method = 'post'>
  20.         <tr><td><b>Naam:</b></td> <td><input type = 'text' name = 'name' value = '<? print($name); ?>' readonly></td></tr><br>
  21.         <tr><td><b>Telefoonnummer:</b></td> <td><input type = 'text' name = 'telefoon' value = '<? print($telnr); ?>' readonly></td></tr><br>
  22.         <tr><td><b>Mobiel:</b></td> <td><input type = 'text' name = 'mobiel' value = '<? print($mobiel); ?>' readonly></td></tr>
  23.         <tr><td></td> <td><input type = 'submit' name = 'verwijderen' value = 'Verwijder'></td></tr>
  24.     </form>
  25.     </table>
  26.    
  27.     <?php
  28.         if (isset ($_POST["verwijderen"]))
  29.         {
  30.             $del_naam = $_POST["name"];
  31.             $del_telnr = $_POST["telefoon"];
  32.             $del_mobiel = $_POST["mobiel"];
  33.            
  34.             $link = mysql_connect ('localhost','root','usbw');
  35.             mysql_select_db ('mydb',$link);
  36.             $query = "DELETE FROM Telefoonnummers WHERE Naam = '$del_naam', Telefoonnummer = '$del_telnr', Mobiel = '$del_mobiel'";
  37.             mysql_query ($query, $link) or die(mysql_error());
  38.         }
  39.     ?>
  40.    
  41.     </body>
  42. </html>
RAW Paste Data
Top