Changes
Page history
dmcqu009 created page: lab 12
authored
Jan 26, 2016
by
Dan McQuillan
Hide whitespace changes
Inline
Side-by-side
lab-12.md
View page @
b864e96a
...
...
@@ -21,7 +21,7 @@ see lecture 11 notes, also
N.B. file permissions on igor: see next slide
## file permissions on igor
##
before we start: checking
file permissions on igor
*
th web user on igor is 'nobody' (verify this yourself with
`ps aux | grep httpd`
)
*
we don't have permission on igor to change group ownership of directories to nobody
...
...
@@ -31,7 +31,7 @@ N.B. file permissions on igor: see next slide
there's some other useful information at https://www.doc.gold.ac.uk/intranet/it/dept-faq.html
## adding album covers to record store
##
exercise:
adding album covers to record store
this is an exercise for the lab, to be continued during the week if you don't finish.
...
...
@@ -39,7 +39,7 @@ we're going to add images to our record store database.
start from the week-8 version that sorrel shared with you.
## backing up the database
##
0.
backing up the database
this will mean altering the database, not just branching the code.
so back up your database!
...
...
@@ -47,11 +47,11 @@ so back up your database!
*
see sorrel's week 8 lectures.
*
also see https://dev.mysql.com/doc/refman/5.0/en/mysqldump-copying-database.html
## alter database
##
1.
alter database
*
add a column for image (name) to the database
## modify form
##
2.
modify form
need to add to the form:
...
...
@@ -59,24 +59,26 @@ need to add to the form:
*
a hidden field for
`MAX_FILE_SIZE`
*
input
`type="file"`
## uploads directory
##
3. create
uploads directory
create an uploads directory
change permissions so it's writeable by the web server process
## handling the upload
##
4.
handling the upload
add code to handle the image upload (see week 11 slides)
## register the image with the database
##
5.
register the image with the database
add the image to the database query
## display the image
##
6.
display the image
display the image in the record listings
## cookies
## 7. extension work: cookies and sessions
## 7.1 cookies
create a simple test to show you can use cookies.
...
...
@@ -85,7 +87,7 @@ see lecture 11 notes, also
*
http://www.w3schools.com/php/php_cookies.asp
*
http://php.net/manual/en/features.cookies.php
## sessions
##
7.2
sessions
create a simple test to show you can use sessions.
...
...
...
...