Practical PHP Tutorial - Project Layout

Chapter 2
As I said in the introduction, we are going to develop a simulation of a online stock trading system. A very good project that helps us to cover every aspect of php.

PROJECT FOLDERS
Create a folder in you root directory named OnlineStock or anything you like. This is going to be our project folder. From now on I will refer this folder as root folder. Create the following folders in the OnlineStock folder. Also create respective files in the

  • OnlineStock/
    • scripts/
      • script.js
      • jquery.js
    • styles/
      • styles.css
    • images/
    • common/
    • index.php
Note: All the folder names are recommended to be in lowercase only. This will ensure that users will not have difficulty in typing the url, as the php servers are really case sensitive.

Scripts Folder will contain all the javascript files. The scripts file is created by you. You have to download the jquery.js javascript library. Please download the latest module from here.
Styles Folder will contain all the css files.
Images Folder accommodates the images we are going to use in the project.
Common Folder will have commonly used php files.

HOME PAGE
The default home page for any php project is index.php. Although you can access any file through you browser, the index page is the start page for any folder at any level in the project. When you are running your project you can just run it as http://localhost/OnlineStock/, which will, by default render the index.php page.

So, create a index.php file in your root folder(/OnlineStock).
Lets start programming!

Comments

Popular posts from this blog

How to show only month and year fields in android Date-picker?

How to construct a B+ tree with example

Conflict Serializability in database