Lab05 Guide
Lab05 Guide
What is the difference between step 2 and step 3? In step two, you only change the
background color temporarily, after the user left the mouse out, the background
color of the page will be restored as before.
1. Design areas to contain the puzzle pieces. The first area is a 2x5 grid to store
original pieces. The second area has a 3x3 grid to store the final result.
Similar to the previous exercise, use the <div> tags associated with css to
create border cells.
2. Load the image and show it to the first area, the order and the angle of the
images are randomly selected.
3. Check out this link for how to use drag and drop in html 5.
https://www.w3schools.com/html/html5_draganddrop.asp
4. Use jquery to rotate puzzle pieces whenever they are clicked.
5. You also need to check to not allow drag and drop on the non empty box.
Exercise 3: To use the APIs, first you need to do some stuff. (see 3. How to setup
server.mp4 for better understanding).
1. Unzip API.zip to the htdocs folder of your web server (eg. XAMPP)
2. Go to PhpMyAdmin, create new database named students and import the
student.sql to the database.
3. Open connection.php and edit the information to suit your serrver: host, mysql
username, mysql password, port…
4. Now using web browser to access this link to test the result:
http://localhost:8888/get-students.php (remember to replace 8888 with your
server port). If you see a json printed then you are ready to do the exercise.
5. See “HTTP Request” example video at “Video tutorials” for more
information.