Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.   if(isset($_POST['new'])) {
  3.      $name = $_POST['name'];
  4.      $thema = $_POST['thema'];
  5.      
  6.      include('/#config.php');
  7.      
  8.      $query = 'INSERT INTO user(
  9.                  name,
  10.                  thema
  11.                )
  12.                VALUES(
  13.                  "'. $name .'",
  14.                  "'. $thema .'")';
  15.      $result = mysql_query($query);
  16.      
  17.      if($result) {
  18.          echo "Erfolgreich hinzugef&uuml;gt wurde:<br />\"". $name ."\" mit der Facharbeit \"". $thema ."\"!<br />";
  19.          echo "<a href=\"/\">Zur&uuml;ck zur Startseite</a>";
  20.      } else {
  21.          echo "Fehler! Name oder Thema bereits vorhanden!";
  22.      }
  23.          
  24.   } else {
  25.      echo "<a href=\"/?p=overview\">&Uuml;bersicht</a>";
  26.      echo "<hr />";
  27.      include('/template/new_form.php');  
  28.   }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement