How to Create Dynamic Website with MySQL & PHP

Learn how to create very easy and simple dynamic website with MySQL and PHP without advanced code knowledge

How to Create Dynamic Website with MySQL & PHP
Creating Dynamic Website with MySQL & PHP
I have been posting tutorials from basic to advance levels. But recently when interacting with some my blog followers (still beginners) I found that they still have trouble doing basic stuff like connecting their php scripts with database. I have been getting many request from my blog followers for a simple php project, although I can’t solve every one issues but can certainly do my part. So this time I have made a mini project on how to create a simple dynamic website with php and mysql. You can download this mini project for free and customize it as per your needs and creativity.

What is this simple website project with php and mysql?

In this mini project you will learn how to connect your database (mysql) with php, setup an html template, make header, footer, dynamic sidebar, fetch title, content, meta tags, meta description for dynamic web pages (individual pages). You can manage these web pages form the manage site area which is like the admin section of the website. You will also learn how to integrate facebook fan page, google badge plugin, and twitter follow button in the sidebar.

Folder and files used in this project

Take a look at the folder and files structure used in this project.
  • Manage Site – This is like an admin folder which contains files to create and view all the dynamic web pages of the website.
    • Cleditor – A light weight javascript library for UI text editor.
    • js – Admin area javascript files
    • home.php – Home page for the admin area
    • header.php – The header part of the admin
    • footer.php – The footer part of the admin
    • manage_pages.php – Manage all the pages that are created or to be created. delete pages from this section
    • add_edit_page.php – Add or edit a page here
    • tagline.php – Update website tagline here
  • libs – It contain configuration files, common functions and database connection script
    • common_functions.php – Commonly used function for the websites and admin area.
    • constants.php – Define constatant like table names, databasebe user access, site name
    • config.php – Database connection script.
  • js – It contains javascript files for the website.
  • images – Images for the website.
  • css – The stylesheet files for the website.
  • index.php – The home page of the website.
  • header.php – Dynamic header of the website.
  • footer.php – Dynamic footer of the website.
  • sidebar.php – Dynamic right sidebar of the website.
  • about-us.php – About us page.
  • contact-us.php – Contact us page with form.
  • category.php – Category page with sub pages.
  • page.php – A dynamic page that will load page content based on id.
Take a look at the database schema with sample records.

How to set up the project in your server.

Follow these steps to setup this project in your server:
  • Download the project zip file (link is available below).
  • Create a folder name simple-website under your htdocs/www folder.
  • In your phpmyadmin create a database named simple-website (you can give any other name too). Execute the SQL file database.sql in your database (remove create statement if you have already create a database).
  • Go to constants.php under libs folder. (libs/constants.php). Replace the database name in DB_DATABASE which your database name, add database username, hostname, passsword.
  • Also change the site URL (HTTP_SERVER and SITE_DIR)

Tips and tricks about the project.

There are some points that you need to remember and follow:
  • The table mp_pages has a field page_name it must be unique for every record. It means that every page must have a unique page name.
  • For the home page use index in the page_name field(mandatory), similarly for other pages like contact-us.php use contact-us(can be some other name ).
  • Pages can be created in two ways, (a) create a physical page with any name e.g. abc.php and then add/upload to your server. then add a database record with a same page which will have all the content, title and meta tags. (b) The other way is just to create a new page through database but with unique page name (this is used when you want pretty page url) and then the content will be called through their ids. like creating a page.php page and getting their contents, title (page.php?id=10).
  • To get a facebook like box plugin you need to create a facebook application first and then you can get the code from this link. If you are having trouble to create facebook application then read this tutorial which will help you in creating facebook application.
  • To get a google badge similar in the website. Go to google developers page. You will just need to replace your google plus/ page id in the url.
 View Demo
I hope this project will help you get started with php and mysql. Share your comments/feedback about this project.



Blogger Tutorials,26,Blogger Widget,1,Blogging Tips,11,Business and Marketing,14,Content Marketing,4,Contextual Marketing,1,Digital Marketing,2,Drupal Theme,1,Drupal Tutorials,7,Email Marketing,2,Games Source Code,2,Information Technology,1,Joomla Tutorials,1,Learn Code,1,Learn CSS,1,Learn XML,1,Make Money Online,9,Online Tools,4,PHP Script,3,SEO Tips,5,Social Marketing,3,Template and Theme,1,Video Marketing,3,Web Design,7,Website Script,3,WordPress Script,1,WordPress Theme,1,WordPress Tools,1,WordPress Tutorial,2,WordPress Tutorials,5,
Teach Sansar - Leading Digital Technology: How to Create Dynamic Website with MySQL & PHP
How to Create Dynamic Website with MySQL & PHP
Learn how to create very easy and simple dynamic website with MySQL and PHP without advanced code knowledge
Teach Sansar - Leading Digital Technology
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy