This commit is contained in:
2026-01-25 03:16:20 -05:00
12 changed files with 127 additions and 1 deletions
@@ -1,3 +1,4 @@
<<<<<<< HEAD
<html lang="en">
<head>
<title>Levi McLean Lab 2</title>
@@ -22,3 +23,22 @@
?>
</body>
</html>
=======
<?php
$favorite_ice_cream = "Mint Chocolate Chip";
$dog_type = "Border Collie";
$dog_type = 12;
define("ERROR_MSG", "You have encountered an error, click the back button and try again.");
echo("Hello World! <br>");
echo("This is PHP. <br>");
echo("This is the first string " . "this is the second string " . "this is my last string <br>");
echo("We are in the month of " . date("F") . "<br>");
echo("The value in the query string for my_var is " . $_REQUEST['my_var'] . "<br>");
echo("My favorite flavour of ice cream is " . $favorite_ice_cream . "<br>");
echo("My dog is a " . $dog_type . "<br>");
echo("My dog is a " . $dog_type . "<br>");
echo ERROR_MSG;
?>
>>>>>>> 8711fbbbbb7d847daf7de42f4de6cd8e6f7d1965
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<title>Lab 3 Form</title>
</head>
<body>
<form action="submit.php" method="post">
<label for="fname">First Name:</label>
<input type="text" name="fname"><br>
<label for="lname">Last Name:</label>
<input type="text" name="lname"><br>
<label for="city">City:</label>
<input type="text" name="city"><br>
<label for="province">Province:</label>
<select name="province">
<option value="Ontario">Ontario</option>
<option value="Quebec">Quebec</option>
<option value="Alberta">Alberta</option>
</select><br>
<button type="submit">Submit</button>
</form>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Lab 3 Submit</title>
</head>
<body>
<?php
$fname = strip_tags($_POST['fname']);
$lname = strip_tags($_POST['lname']);
$city = strip_tags($_POST['city']);
$province = strip_tags($_POST['province']);
echo "<p>$fname $lname is from the city of $city, $province</p>";
?>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

@@ -0,0 +1,2 @@
<?php
echo "Lab1 - 1202885 - Levi McLean";
Binary file not shown.
@@ -0,0 +1,60 @@
<html>
<head>
<title>Levi McLean Lab 1</title>
<script language="JavaScript" type="text/JavaScript">
// VideoType constructor
function VideoType(title, category, cast, price) {
this.title = title;
this.category = category;
this.cast = cast;
this.price = price;
this.numRents = 0;
this.vidRevenue = 0.0;
}
// procRental method
VideoType.prototype.procRental = function() {
this.numRents++;
this.vidRevenue += this.price;
VideoType.totRevenue += this.price;
}
// Variable to hold total revenue
VideoType.totRevenue = 0.0;
// Function to create video array on window load
function StartMeUp() {
var videos = [];
// Create three VideoType objects
videos[0] = new VideoType("Fear and Loathing in Las Vegas", "Comedy", ["Johnny Depp", "Benicio Del Toro"], 3.99);
videos[1] = new VideoType("The Matrix", "Sci-Fi", ["Keanu Reeves", "Laurence Fishburne"], 4.99);
videos[2] = new VideoType("The Lion King", "Animation", ["Matthew Broderick", "Jeremy Irons"], 2.99);
for (var i = 0; i < 5; i++) {
for (var j = 0; j < videos.length; j++) {
videos[j].procRental();
}
}
// Print info about each video
for (var k = 0; k < videos.length; k++) {
document.write("Title: " + videos[k].title + "<br>");
document.write("Category: " + videos[k].category + "<br>");
document.write("Cast: " + videos[k].cast.join(", ") + "<br>");
document.write("Price: $" + videos[k].price + "<br>");
document.write("Number of rents: " + videos[k].numRents + "<br>");
document.write("Revenue for this video: $" + videos[k].vidRevenue.toFixed(2) + "<br><br>");
}
document.write("Total Revenue for all videos: $" + VideoType.totRevenue.toFixed(2) + "<br>");
}
// Call StartMeUp on window load
window.onload = StartMeUp;
</script>
</head>
<body>
</body>
</html>
Binary file not shown.
Binary file not shown.