phpocean: Code is Clay
  • Tutorials
    • Front end
    • Back end
    • Computer skills
    • Design & illustration
    • See all »
  • Forum
  • Blog
  • Contact
  • Log In|Join free

Create a Professional Desktop Application With PHP And PHP Desktop

Previous article

Make your first CRUD with PHP - Part 2 : Admin login panel

Next article

Make your first CRUD with PHP: case of a product management system

By zooboole Jan 13th, 2016 Demo   PDF </>

PHP is probably one of the easiest programming languages to learn. But in thas aspect resides many traps which prevents many people from really coding in PHP.

For example, many people take years contenting themselves with others codes. All they do is to google any thing they need and manage with the little knowledge in HTML to arrange something. They probably come out with acceptable solutions, but for how long? would you like to learn more for the future or you just want to remain outdated? Do you to want to create a working website by yourself?

Here are problems I noticed in most beginners:

  • They don't know how to organize a new project folders
  • They don't know how to plan, even a simple, application
  • They don't know much about HTML
  • They don'y know how to layout a simple web page
  • They don't know how to create an adequate data model(databases, tables,etc) for a given application
  • They can't create a basic code to save data in a database by themselves without piping at someone's
  • etc.

Do not take this wrong, it's just for the purpose of this course. Nothing personal.

I intend to help you solve some of those problems through this little tutorial on how to Create, Read, Update, and Delete data from a database using PHP programming language. In order to illustrate it very well I am going to use a case of products management application. This is far from being a great and perfect example but I think it will suffice to show you how that is done. Beside, the products management system I am going to create here is a very basic one.

  • Read Part 2 here »
  • Have a look at what we are going to do here »

How is the system going to work?

First we will create an admin access which will allow many admins to login with their username and password.

Once they are logged in they will be able to do following:

  • Add a product
  • View the full list of products
  • View a product's details
  • Edit a product
  • Delete a product

Coding standard

I like to precise the coding standard I use for each project in order to make my code accessible to everyone. I have decided not to go for any framework because I assume a beginner who has problems like in this topic would not appreciate a framework or would not know how it works.

Still, I will be going for Object Oriented paradigm, because I intend to promote good habits.

That said I am going to use a simple folder structure, and make a single file for each functionality we have to implement. For example, index.php for the home page, list-products.php to display the list of products, etc.

Project structure

The project structure/folder structure actually shows how your code is saved in your hard drive. It also shows how different files/functionalities are co-related. That actually helps you know how you can make each part of your application interaction with other.

The other advantage of this is that it helps make clean and maintainable codes, and all frameworks are very good at that.

For this project I will go simple. The root folder will be called pms. Inside it I will be creating an index.php file which is going to be the starting point of our application. In the root folder I will also add some folders: config, this one will contain the configuration files of the application like database connection, and parameters settings; includes folder will contain all common parts to the application's files like headers, footers, etc; a public folder to put in all images and css files, though we will not have much to do with them, but it's good to explain it. So can start by creating the following folders structure:

  • pms/
    • config/
      • dbconnect.php
    • includes/
      • functions.php
    • public/
      • css
        • style.css
      • images
  • index.php

PS: this number of files is going to change when I start creating more files or other sub-folders.

This is it. We're now set to start coding the project. I'm going to make this tutorial in short parts to keep you guys motivated and strong. So in the next part I am going to tackle the creation of admins and their logging in aspect. Stay tuned and see you around.

Sharing is caring, help us by sharing

Twitter Facebook Pinterest Linkedin
zooboole

zooboole
Hey! I am Ahmed Salifou Amidou aka Zooboole. Full-Stack & Full-time Web Developer. I am always learning and sharing at the same time what I discover. I am currently writing a book check it out at: www.webdevelopmentstarterkit.com

Related tutorials

  • Create a Professional Desktop Application With PHP And PHP Desktop

    January 26th, 2017 | Back End
  • Learn how to use PHP sessions

    June 19th, 2016 | Back End
  • Start with PHP Exceptions

    June 7th, 2016 | Back End
Advertisement

Leave a comment

Log in to comment with your phpocean account or use the form bellow to comment as a guest


Don't miss any tutorial again

Receive fresh and new tutorials right at the moment they are published into your private email

Recent tutorials

  • Here's how I forced myself to learn ReactJS September 4th, 2018
  • How to disable the touchscreen drivers permanently on Ubuntu 17.10 March 11th, 2018
  • The science of creating fixed components on scroll with vanilla JavaScript February 13th, 2018
more »
Write for us Want to become an author on phpocean.com? Request a tutorial Can't see a particular tutorial? Ask for it.

Latest updates

  • Learn a bit of offline coding January 21st, 2019
  • Secrets developers never tell anyone, even to mom January 16th, 2019
  • 6 reasons why you should blog as a software developer November 21st, 2018
  • 5 toughest questions from self-taught developers and their answers October 28th, 2018
  • 4 Most suitable Programming Language for Beginners October 11th, 2018
  • 10 Guest Post Email Request Tips to get you accepted September 20th, 2018
  • DevCongress V9 just took place - here is what you should know July 22nd, 2018
more »
  • About us
  • Faq
  • Policy & Terms
  • Advertise with us
  • Contact
  • Discussions
  • Vialactea Technologies
Copyright © 2015 - 2019 phpocean.com. by Vialactea Technologies Ltd. Except where noted, all rights reserved - Proudly made in Ghana .:. Powered by zooboole.me.