Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $username = "phpdood";
  4. $password = "PopenHsesameP";
  5. $database = "kj_database2";
  6. mysql_connect($host,$username,$password);
  7. @mysql_select_db($database) or die("Unable to select database: ". mysql_error());
  8.  
  9. $name = $_POST['name'];
  10. $age = $_POST['age'];
  11. $eye_colour = $_POST['eye_colour'];
  12. $height = $_POST['height'];
  13. $weight = $_POST['weight'];
  14.  
  15. $query = "INSERT INTO kj_datatable2 (name,age,eye_colour,height,weight)VALUES('$name',$age,'$eye_colour','$height',$weight)";
  16.  
  17. print $query;
  18. mysql_query($query);
  19. mysql_close();
  20. ?>
  21.  
  22. <script type="text/javascript">
  23. window.location = "/index.html";
  24. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement