PHPiggy Bank
How do I make an phpiggy bank?
What is a phpiggy bank? How do you make a phpiggy bank? This script and codes were developed by Emily K on 09 September 2022, Friday.
PHPiggy Bank - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>PHPiggy Bank</title>
</head>
<body>
<html>
<head> <title>PHPiggy Bank</title>
<?php # Define 4 different variables, which will each represent how much a given coin is worth $penny_value = .01; $nickle_value = .05; $dime_value = .10; $quarter_value = .25; $half_value = .50; # Define 4 more variables, which will each represent how many of each coin is in the bank $pennies = 300; $nickles = 5; $dimes = 0; $quarters = 125; $half = 33; # Add up how much money is in the piggy bank $total = ($pennies * $penny_value) + ($nickles * $nickle_value) + ($dimes * $dime_value) + ($quarters * $quarter_value) +($half * $half_value) ; #Define a variable $goal and set it to be 50. $goal = 50; #Write an if statement which will set a a variable called $image to be either php-goal-met.png or php-goal-not-met.png. if($total > $goal) { $image = 'php-goal-met.png'; } else { $image ='php-goal-not-met.png'; } ?>
</head>
<body> <img alt='PHPiggy Bank Logo' src='https://thewc.co.s3.amazonaws.com/challenges/php-phpiggy-bank.png'> <p> You have $<?php echo $total; ?> in your piggy bank. You have <?=$quarters?> quarters in your bank. </p> <p> <img src='https://thewc.co.s3.amazonaws.com/challenges/<?php echo $image; ?>' alt='Goal Status'> </p>
</body>
</html>
</body>
</html>
Developer | Emily K |
Username | Emnk |
Uploaded | September 09, 2022 |
Rating | 3 |
Size | 1,693 Kb |
Views | 24,288 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Pick a texture | 2,284 Kb |
A Pen by Emily K | 6,961 Kb |
Fluid layout practice v3 with map | 8,749 Kb |
Bonus Features | 5,994 Kb |
Fluid layout practice | 3,293 Kb |
BOMP Test | 5,138 Kb |
Boston Middle Passage Profile Gallery Beta | 3,388 Kb |
Practice using Wixel | 3,057 Kb |
Flagg CSS Practice | 2,597 Kb |
Done - Monster Mash | 1,953 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Sticky div | Kaslab | 2,225 Kb |
Multicolumns 2 | Raphaelgoetter | 1,857 Kb |
Ghost Buttons with CSS3 | Mithicher | 2,509 Kb |
Sketchy Box | Mnicpt | 3,033 Kb |
Navcube | Wbarlow | 4,775 Kb |
Michelle, submit your photography to Unsplash. | Zaneriley | 3,368 Kb |
NgEasyModal | Lorenzodianni | 4,159 Kb |
We Simplify animation | Meodai | 48,169 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
Lazy Load for Background Images | The_ruther4d | 2,977 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!