Setup a Complete PHP Site (activity 3)
Written by: Jonathan Briggs
October 16, 2008 [5095 views]
prepared by Jarek Francik
UPDATE 19 October
Jarek had some technical problems with his site and therefore I have decided to move the deadline for this activity to next Friday 24th. The link to feedback your answers is http://www.zoomerang.com/Survey/?p=WEB228D7EKSDGG
In this activity you will setup a complete functional PHP site with MySQL database on your private computer or laptop (no Internet connection or hosting required).
In Part 1 you will simply follow the same steps as shown during the lecture, and a step-by-step guide is available to help you.
In Part 2 you will extend slightly the PHP code. At this stage you will be required either to know something about PHP or read about it. Both parts 1 and 2 are mandatory.
Part 3 is optional, but even if you decide not to go through it – at least read it and think about it. One of the questions you will have to answer at the end of the activity will relate to this part.
Important: This activity is supposed to be an exercise in PHP/MySQL installation and programming. It may help you if your final year project is web or PHP related.
It will also help you even if you are going to use a web technique other than PHP – some principles will always remain the same. It is however not our intention to suggest that you should normally build your on-line shops from scratch. Always get advice from your supervisor.
Part 1: Run a simple PHP code on an Apache server
- Install Apache server with PHP and MySQL database
- Create and run a phpinfo() script
- Prepare a simple cart application as shown in the lecture.
At this stage you can download the code from a site provided below but it is strongly recommended to try to write it by yourself, if at all possible...
In this part visit my site at http://openboard.co.uk/php to find a comprehensive guide and PHP source files. Follow the Path 2: Installing on your own machine, which is a typical approach for a developer.
Part 2: Enhance Your Application
- Enhance the Home Page of your on-line shop so that the user could see the list of all items he or she can buy. For each product provide “Add to Cart” link.
- Make the name of each item clickable and provide a page capable to display more detailed description of the product.
It’s good if you know some PHP at this stage. Otherwise – just google for “w3 schools” to get a comprehensive introduction not only to PHP but also a variety of useful web techniques. If you still find the task difficult – just search! There is plenty of step by step guides and even ready-to-use snippets of code – you can use it! Just ensure are not violating the copyright.
Part 3: Finish Your Application
This part is not obligatory. But read it and think about it even if you are not doing it.
- Add pictures. Think how to store them and how to append the information about them to your database.
- Add categories of products. Think how the database should be enhanced to accomplish it.
- Create a graphical design with a CSS stylesheet. You will find a very raw stylesheet in your PHP introductory guide (http://openboard.co.uk/php).
- To complete your site, you can think about an admin page where you could add and remove items.
Recent comments:
What do you think?
On October 16, 2008 at 9:21 AM, Pedro Matias wrote:
Jonathan, the link http://openboard.co.uk/php above apperas to be broken. Going to HTTP 404 in i.e.7.
Using Chrome as well but the suggested openboard.co.uk link takes me to the desired page.
Looking forward to the lecture.
Jonathan replies: I will mention it to Jarek!