For this and future labs (and when working in the lab on your own) you will be using sftp - a program that allows you to transfer files similarly to scp, but sftp keeps the connection between the two machines open so that you don't need to type in your password every time. Here is how you use sftp:
cdcommand to switch to this directory.
sftp ryniteat the command prompt, type in your password when asked
cd public_htmlto get to your public_html directory. If you want to get to a subdirectory of public_html, say, lab3, you can type in
cd public_html/lab3instead. To create a new directory, type
mkdir lab3(or any name you want to give to the new directory), followed by
cd lab3to get into the new directory.
put filename(where you replace filename by the actual file name).
|pwd||shows your current directory on rynite|
|lpwd||shows your current directory on the lab machine|
changes your current directory on rynite (
changes your current directory on the lab machine (
|ls||shows your files in the current directory on rynite|
|lls||shows your files in the current directory on the lab machine|
|quit or exit||exits sftp|
<!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 email@example.com Last modified: 2/9/06 --> <?php $celsius = -5.5; ?> <html> <head> <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.Use the variable $celsius in your computation.
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 firstname.lastname@example.org Last modified: 2/9/06 --> <?php $person = "someone"; $place = "somewhere"; $object = "something"; ?> <html> <head> <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 so that when the program is run, the values of these variables are displayed. Upload your file into your public_html on rynite and make sure that it works. Then change the values of the three variables, upload the file again, and make sure that the story changed.
This page is a part of CSci 1101 course web site.
The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.