Although this site has been produced for specific courses and groups of students it is designed as a public resource. If you find it useful then please let me know.

If you want to comment feel free to do so and if you find something wrong get in touch.

hide alert

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:

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!

On October 16, 2008 at 3:14 PM, Richard Smith wrote:

What is the deadline for this activity please?

Jonathan replies: Tuesday 21st Midnight, as usual!

On October 18, 2008 at 7:25 PM, Amandeep S. Kang wrote:

How do we submit this weekly activity for the 1% mark? Also, I think the activity was supposed to be amended slightly since not all of this was covered by Jarek before the lecture concluded.

Jonathan replies: The link to the feedback survey is above. Jarek has said to leave our question 15.

On October 18, 2008 at 8:10 PM, Lloyd wrote:

Hi, what is meant to be handed in this week - and how? as there's no mention on here, or Jarek's site of how to submit anything - if indeed, anything should be submitted!?

Thanks for any info!

Jonathan replies: See above.

On October 19, 2008 at 12:29 PM, adam plowman wrote:

I have submitted two set of information by mistake. One was a half filled questionnaire and the other was fully completed. Please discard the half filled one.

Thanks

Adam

Jonathan replies: Thats fine!

On October 20, 2008 at 5:32 PM, Kazeem wrote:

I'm having problems downloading php. Is it recommended to download the latest versions of all the software? (php, apache, mysql)

Jonathan replies: I will get Jarek to comment

On October 21, 2008 at 8:26 AM, richard wrote:

have manually installed php and used windows installer but am get HTTP 404 error when testing the test.php.

followed all the instructions to install php, what else can I do?

Apache is intalled and working

Jonathan replies: 404 says that it cannot find the URL (file) that your are trying to find. Check to see whether it is the test.php file that is causing the 404 or another file. Ask Jarek if you are still stuck.

On October 22, 2008 at 5:18 PM, Haider wrote:

hi can i use cross platform like WAMP INSTEAD and note down the technical information like apache server type etc and php type,and run the appropriate scripts through that,rather then installing php apache individually.

Jonathan replies: yes

What do you think?







Add your comments