Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> BAI CALCULATOR </title>
- <body>
- <?php
- $servername = "istdata.bk.psu.edu";
- $username = "931391671";
- $password = "berks1671";
- $dbname = "amc6604";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "CREATE TABLE MyGuests (
- id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
- height FLOAT(5,2) NOT NULL,
- hip FLOAT(5,2) NOT NULL,
- sheight Float(10,4),
- reg_date TIMESTAMP
- )";
- <?php function writeMsg(){
- $height = $_GET["height"];
- $hip = $_GET["hip"];
- $sheight = sqrt($height);
- $bai = ((100 * $hip) / ($sheight * $height)) - 18;
- echo "height" . $height . "<br>";
- echo "Hip circumference" . $hip . "<br>";
- echo "Your BAI is" . $bai;
- }
- writeMsg();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement