![]() |
![]() Second Summer 2009 |
Can you state it as a problem? Can you solve it?
Here's the code in Perl:
#!/usr/bin/perl
use CGI;
$q = new CGI;
print $q->header, $q->start_html;
$count = $q->param('count') + $q->param('add') + 0;
print qq{
<table border cellpadding=2>
<tr><td colspan=2 align=center> <h1>$count</h1>
<tr><td width=50% align=center> <a href="?count=$count&add=-1">Down</a> <td> <a href="?count=$count&add=1">Up</a>
</table>
};
print $q->end_html;
Explain how it works. Implement it in Python. How about this program? Can you implement it?
In lab we will also discuss HTTP and help you set up a password protected folder, where you can post your homework code.
We will add to these notes in real time, in class.
Here are the pages from the book (one, two) with info on how to set up the protected folder.
To post the source code:
~/apache/cgi-bin/something)
protected folder set up already
~/apache/htdocs/protected and issue
ln -s ../cgi-bin/something abc.txt
http://silo.cs.indiana.edu:44xxx/cgi-bin/something calls your program,
http://silo.cs.indiana.edu:44xxx/protected/abc.txt will take it to its source code
something changes the abc.txt link reflects the change without your intervention