Posting a Blog
Firstly, I created a page with a simple html form, with fields for the blog's title, content and an upload file field. When submitted, the form runs insert.php which uses SQL to insert the form contents into the appropriate fields in the blog database table. If the user selects an image to upload, the insert.php file also uploads this image to a directory named /blogimages on the server. So if the user uploads an image called img.png, the file will be uploaded to stephengreig.co.uk/newjack/blogimages/img.png. The text img.png will be inserted into the image field in the MYSQL database table.

When the form is submitted, the form content is inserted into the blog database table as shown in the image below.

Now the data is in the database, the blog.php is updated with the new blog post.
Login System
Obviously, we don't want any random user to be able to add blog posts to the blog, so I have made the admin area page require the user to be logged in. There is a button on the blog page which reads 'admin area', which when clicked takes the user to adminlogin.php. This page simply features a html form (with username and password fields) which when submitted runs login.php.
The login.php file then checks to see if the username and password entered are in the members database table; if they aren't the user is redirected to a page which reads login failed; if the username and password entered are in the members database table then the user is redirected to the admin area page where they can then add a blog post.
It is important to note that the admin area page also features some php code that says the page requires auth.php in order for it to be displayed. The auth.php file basically checks to see if the user is logged in or not.
Also in the admin area page is a logout link which when clicked runs logout.php. This file ends the user session and redirects them to a page which tells them they have been logged out.
Remaining Tasks
- Make user able to edit blog posts
- Make user able to delete blog posts
- Make file upload in post blog form accept image AND mp3 files
- Make gigs page so it is populated using a MYSQL database
- Make add/edit/delete gigs form in admin area
- Make PHP contact form

Hi Stephen,
I agree with you 100%,I wrote something similar on my own journal yesterday. I'm fed up of being frustrated and turning upto seminars that don't really help and then there is the moody lecturers.
I still have my log in to complete, I'm struggling with styling up PHP and the journal posts page.
Happy Days
Steven