This is just a reminder of basic sftp commands.
cd
command
to switch to this directory.sftp rynite
at the command prompt, type in your
password when askedcd public_html
to 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/lab
instead. To
create a new directory, type mkdir lab
(or any name you
want to give to the new directory), followed by cd lab
to get into the new directory. put
filename
(where you replace filename by the
actual file name). get
filename
pwd | shows your current directory on rynite |
lpwd | shows your current directory on the lab machine |
cd |
changes your current directory on rynite (cd .. brings
you one level up)
|
lcd |
changes your current directory on the lab machine (lcd .. brings
you one level up)
|
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">
<!--
Exercise on if/else statements
Author: Elena Machkasova elenam@morris.umn.edu
Last modified: 2/13/06
-->
<?php
$date = $_GET["input"]; // Assuming February 2006
?>
<html>
<head>
<title>
Days of the week
</title>
</head>
<body>
<h2>
<?php
// Sally has a Computer Science class on Tuesdays and Thursdays
// and Biology on Mondays, Wednesdays, Fridays
// Assuming that $date has the date in February 2006,
// Make the page print what class she has on a given day, or,
// if it's a weekend, print "Have a nice weekend"
if ( ($date % 7) == 0) {
print "Today is Tuesday<br/>\n"; // a sample code - need
// to change
}
?>
</h2>
</body>
</html>
Your task for this question is to make the program behave as written in the comments. Note that the sample output in the above program is not what's required: you don't need to print out the days of the week, instead you need to say what classes Sally has on the day given as an input or whether it's a weekend.
Some hints:
||
to combine the conditions. For instance, Sally
has a Computer Science class if it's Tuesday or Thursday. ?input=17
. Make sure to try your program with different
inputs.This page is a part of CSci 1101 course web site.