daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // Forbind til vores database
  3. include('db.php');
  4.  
  5.  
  6. if (isset($_POST['firmanavn'])) {
  7.     // Opret ny kunde
  8.     $firmanavn = $_POST['firmanavn'];
  9.     $adresse = $_POST['adresse'];
  10.     $postnr = $_POST['postnr'];
  11.     $bynavn = $_POST['bynavn'];
  12.     $land = $_POST['land'];
  13.     $email = $_POST['email'];
  14.     $tlf = $_POST['tlf'];
  15.    
  16.     $db->query("INSERT INTO kunder(firmanavn, adresse, postnr, bynavn, land, email, tlf) VALUES ('$firmanavn','$adresse','$postnr','$bynavn','$land','$email','$tlf') ");
  17.    
  18.     $kundeid = $db->insert_id;
  19.    
  20.     header('Location: viskunde.php?kundeid=' . $kundeid);
  21.     exit();
  22. }
  23.  
  24. // Start vores side.
  25. $aktiv_menu = 'kunder';
  26. include('templates/side_start.php');
  27.  
  28. ?>
  29. <h3>Opret ny kunde:</h3>
  30.  
  31. <form action='opretkunde.php' method='post'>
  32. <table>
  33.    
  34.     <tr>
  35.         <td class='tabel-label'>Firmanavn</td><td class='tabel-felt'><input type='text' name='firmanavn' size='30'></td>
  36.     </tr>
  37.     <tr>
  38.         <td class='tabel-label'>Adresse</td><td class='tabel-felt'><textarea name='adresse' cols='30' rows='3'></textarea></td>
  39.     </tr>
  40.     <tr>
  41.         <td class='tabel-label'>Postnummer</td><td class='tabel-felt'><input type='text' name='postnr' size='10'></td>
  42.     </tr>
  43.     <tr>
  44.         <td class='tabel-label'>By</td><td class='tabel-felt'><input type='text' name='bynavn' size='30'></td>
  45.     </tr>
  46.     <tr>
  47.         <td class='tabel-label'>Land</td><td class='tabel-felt'><input type='text' name='land' size='30'></td>
  48.     </tr>
  49.     <tr>
  50.         <td class='tabel-label'>E-mail</td><td class='tabel-felt'><input type='text' name='email' size='30'></td>
  51.     </tr>
  52.     <tr>
  53.         <td class='tabel-label'>Telefon</td><td class='tabel-felt'><input type='text' name='tlf' size='30'></td>
  54.     </tr>
  55.     <tr>
  56.         <td class='tabel-label'></td><td class='tabel-felt'><input type='submit' value='Opret'></td>
  57.     </tr>
  58. </table>
  59. </form>
  60. <?
  61. // Slut på vores side.
  62. include('templates/side_slut.php');
  63. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top