Guest User

Untitled

a guest
Apr 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3.     //include the connect-script
  4.     include("connect.php");
  5.    
  6.     //if the superglobal $_POST['name'] is set, insert the data in the database
  7.     if(isset($_POST['name'])){
  8.         mysql_query("INSERT INTO users (name)
  9.                     VALUES ('$_POST['name']')";
  10.     //else, echo the form
  11.     }else{
  12.         echo '<form method="post" action="">
  13.         Naam: <input type="text" name="name" /><br />
  14.         <input type="submit" value="Registreren!" />
  15.         </form>';
  16.     }
  17.        
  18.    
  19. ?>
Add Comment
Please, Sign In to add comment