Chapter 1 Test 1 - Code

Recap 1.1 - 1.8

Chapter 1 Main




<?php require_once "../mainfunctions.php" ?>
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>1.8 Test </title>
<meta name="viewport" content="width=device-width; initial-scale=1.0">
<link rel="stylesheet" href="../chapterstyles.css">
</head>

<body>

<div>
<header>
    <h1>Chapter 1 Test 1 </h1>
    <h3>Recap 1.1 - 1.8</h3>
</header>
</div>


<div id="chapterMain">
<a href="chapter1main.php">Chapter 1 Main</a>
</div>

<div>
<?php
$download = "true";
$shipping = "2.99";
$title = "<p id='note'>Cost by Quantity";
$downloadTitle = "- Downloads</p>";
$cdTitle = "- CDs | Shipping is $2.99 per order</p>";
?>
</div>





<div>
<?php

if($download=="true"){

    echo "$title  $downloadTitle";

    $price="9.99";
    
    $quantity=1;
    
    while ($quantity < 7){ 
        $price = $price * $quantity; 
        echo "$quantity for $price<br>"; 
        $quantity = $quantity + 1;
        $price="9.99";
    }
}


$download = "false";



if($download=="false"){

    echo $title . $cdTitle . "..";

    $price = "12.99";
   
    for($quantity=1; $quantity < 7; $quantity++){
        $price = $price * $quantity; 
        $total = $price + $shipping; 
        echo "$quantity for $total<br>"; 
        $price="12.99";	
    }
}


?>

</div>


<br><br>



<?php 
printFootWithCodeExample("1.8test1code.php");
?>
</body>
</html>




BACK