Consider a php program here. Write (on paper) the html source of the part of the page generated by php. Then click on the link, open the page, and compare the source with what you have written. If there are any differences, make sure you understand them.
Please submit your original answer.
You are given a php program that has a variable $celsius for temperature in celsius:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Celsius/Fahrenheit converter
Author: Elena Machkasova elenam@morris.umn.edu
Last modified: 2/16/08
-->
<?php
$celsius = -5.5;
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>
Celsius/Fahrenheit converter
</title>
</head>
<body>
<p>The current temperature is <? print $celsius?>C. </p>
</body>
</html>
Tf = (9/5)*Tc+32; Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit.
Convert this formula into PHP, use the variable $celsius for temperature in celsius.You are given the following code that you need to save in a file madlibs.php
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Lab 3 PHP problem
Author: Elena Machkasova elenam@morris.umn.edu
Last modified: 2/9/06
-->
<?php
$person = "someone";
$place = "somewhere";
$object = "something";
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>
Madlibs page: change the variables and read a new story
</title>
</head>
<body>
<h2>Madlibs page: change the variables and read a new story</h2>
<p>
<!-- Here goes your story -->
</p>
</body>
</html>
Your task is to write a story that has in it a person, a place, and an object (at least two of these should be used more than once in the story). Use the php variables $person, $place, and $object. After you add a sentence, save the file and make sure that the program works. Add another sentence, save and check again. Continue until the story is completed. Change the values of the three variables, save the file again, and make sure that the story has changed.
Just save the two files on csci1101sp09 or, if using remote access, upload them to csci1101sp09.
This page is a part of CSci 1101 course web site.