... | @@ -21,7 +21,7 @@ see lecture 11 notes, also |
... | @@ -21,7 +21,7 @@ see lecture 11 notes, also |
|
|
|
|
|
N.B. file permissions on igor: see next slide
|
|
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`)
|
|
* 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
|
|
* 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 |
... | @@ -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
|
|
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.
|
|
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. |
... | @@ -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.
|
|
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.
|
|
this will mean altering the database, not just branching the code.
|
|
so back up your database!
|
|
so back up your database!
|
... | @@ -47,11 +47,11 @@ so back up your database! |
... | @@ -47,11 +47,11 @@ so back up your database! |
|
* see sorrel's week 8 lectures.
|
|
* see sorrel's week 8 lectures.
|
|
* also see https://dev.mysql.com/doc/refman/5.0/en/mysqldump-copying-database.html
|
|
* 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
|
|
* add a column for image (name) to the database
|
|
|
|
|
|
## modify form
|
|
## 2. modify form
|
|
|
|
|
|
need to add to the form:
|
|
need to add to the form:
|
|
|
|
|
... | @@ -59,24 +59,26 @@ need to add to the form: |
... | @@ -59,24 +59,26 @@ need to add to the form: |
|
* a hidden field for `MAX_FILE_SIZE`
|
|
* a hidden field for `MAX_FILE_SIZE`
|
|
* input `type="file"`
|
|
* input `type="file"`
|
|
|
|
|
|
## uploads directory
|
|
## 3. create uploads directory
|
|
|
|
|
|
create an uploads directory
|
|
create an uploads directory
|
|
change permissions so it's writeable by the web server process
|
|
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)
|
|
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
|
|
add the image to the database query
|
|
|
|
|
|
## display the image
|
|
## 6. display the image
|
|
|
|
|
|
display the image in the record listings
|
|
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.
|
|
create a simple test to show you can use cookies.
|
|
|
|
|
... | @@ -85,7 +87,7 @@ see lecture 11 notes, also |
... | @@ -85,7 +87,7 @@ see lecture 11 notes, also |
|
* http://www.w3schools.com/php/php_cookies.asp
|
|
* http://www.w3schools.com/php/php_cookies.asp
|
|
* http://php.net/manual/en/features.cookies.php
|
|
* http://php.net/manual/en/features.cookies.php
|
|
|
|
|
|
## sessions
|
|
## 7.2 sessions
|
|
|
|
|
|
create a simple test to show you can use sessions.
|
|
create a simple test to show you can use sessions.
|
|
|
|
|
... | | ... | |