Midterm solutions 1. CSS /* NOTE: This question did not copy correctly on the exam so the question was altered. The solution below is the solution that was used to grade the exam. You will note that it does not match the picture on the exam exactly but it does match what you saw / read on the exam. */ div { margin: 5px; } #gallery > img { width: 60px; height: 60px; margin: 10px; } #gallery { width: 20%; } p { background-color: yellow; padding: 20px; } #bigPic { width: 75%; } #bigPic > div { clear: left; border: none; } #gallery, #bigPic { float: left; } #more { clear: left; } #contentArea { width: 90%; margin-left: auto; margin-right: auto; background-color: white; } body { background-color: gray; } h3 { text-align: right; } div, h3 { border: 2px black solid; } 2. PHP horoscope

Find your horoscope!

horoscope-submit.php 0) { $r = rand(0, count($files) - 1); $file = $files[$r]; setcookie("sign", $sign); setcookie("file", $file, time() + 60 * 60 * 24); $display = file_get_contents($file); } } ?>

horoscope for today:

3. SQL SELECT * from movies m JOIN roles r1 ON m.id = r1.movie_id JOIN roles r2 ON m.id = r2.movie_id JOIN actors a1 ON r1.actor_id = a1.id JOIN actors a2 ON r2.actor_id = a2.id WHERE a1.first_name = 'fred' AND a1.last_name = 'astaire' AND a2.first_name = 'ginger' AND a2.last_name = 'rogers' ORDER BY m.year DESC, m.name