Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title> BAI CALCULATOR </title>
  4. <body>
  5. <?php
  6. $servername = "istdata.bk.psu.edu";
  7. $username = "931391671";
  8. $password = "berks1671";
  9. $dbname = "amc6604";
  10.  
  11. $conn = new mysqli($servername, $username, $password, $dbname);
  12. if ($conn->connect_error) {
  13. die("Connection failed: " . $conn->connect_error);
  14.  
  15. }
  16. $sql = "CREATE TABLE MyGuests (
  17. id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  18. height FLOAT(5,2) NOT NULL,
  19. hip FLOAT(5,2) NOT NULL,
  20. sheight Float(10,4),
  21. reg_date TIMESTAMP
  22. )";
  23.  
  24. <?php function writeMsg(){
  25. $height = $_GET["height"];
  26. $hip = $_GET["hip"];
  27. $sheight = sqrt($height);
  28.  
  29. $bai = ((100 * $hip) / ($sheight * $height)) - 18;
  30.  
  31. echo "height" . $height . "<br>";
  32.  
  33. echo "Hip circumference" . $hip . "<br>";
  34.  
  35. echo "Your BAI is" . $bai;
  36. }
  37. writeMsg();
  38.  
  39.  
  40. ?>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement