A simple program to ask the user to give length in fee and convert it into inches using PHP programming language.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Progam Listing
<?php
$value_in_inches = "";
if (isset($_POST["txtValueInFeet"])) {
$value_in_inches = (int)$_POST["txtValueInFeet"] * 12;
$value_in_inches = "<strong>". $_POST["txtValueInFeet"] ."</strong>".
" feet is equal to <strong>". $value_in_inches ."</strong> inches";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Feet To Inches in PHP</title>
<style>
*,html {
box-sizing: border-box;
padding: 0;
margin: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #fefefe;
font-family: sans-serif;
background-color: #19BC9D;
}
.container {
background: #fff;
border: none;
text-align: center;
color: #fff;
width: 470px;
}
.title {
background-color: #14A083;
padding: 20px;
border: none;
}
.wrapper {
padding: 30px 20px;
font-size: 20px;
background-color: #fff;
border: none;
color: #14A083;
}
form {
margin-bottom: 20px;
}
h1 {
margin: 0 0 5px;
line-height: 1;
}
p {
margin: 15px 0 0;
}
input {
display: block;
width: 100%;
margin-bottom: 20px;
padding: 10px;
font-size: 15px;
text-align: center;
}
.output {
margin: 10px 0;
}
button {
background-color: #14A083;
color: #fff;
border: none;
border-radius: 2px;
text-align: center;
text-transform: uppercase;
text-decoration: none;
cursor: pointer;
font-size: 15px;
padding: 15px 10px;
width: 100%;
display: block;
margin: 20px 0 0;
}
</style>
</head>
<body>
<div class="container">
<div class="title">
<h1>Feet To Inches In PHP</h1>
<p>Created By:</p>
<h2>» Jake R. Pomperada, MAED-IT, MIT «</h2>
</div>
<div class="wrapper">
<form action="" method="post">
<label>Enter a number here</label>
<input type="number" name="txtValueInFeet" required>
<button type="submit" name="btnSubmit">Convert</button>
</form>
<?php echo $value_in_inches;?>
</div>
</div>
</body>
</html>
No comments:
Post a Comment