Page Contents
Step-by-Step guide to create dynamic web pages using HTML, CSS, PHP & MySQL.
This post is for the persons who are beginners in the web development field.
In this post, I will cover everything step by step starting from designing and development. At the last we will see how to deploy the website online.
Steps to create a website:
- Download and install a code editor on your computer for writing HTML, PHP etc. code.
- Download and install XAMPP Server on your computer.
- Start Apache and MySQL server.
- Start designing and developing your website with SQL queries.
- Test your website on your computer.
- Deploy your website on online server.
Step 1: Download a code editor
There are very code editors available for free like visual code, notepad++, Sublime etc. Download and install any one of them.
Step 2: Download XAMPP
Download and install XAMPP Server on your computer. XAMPP is the most popular PHP development environment. XAMPP is a completely free, easy to install Apache distribution containing MariaDB, PHP, and Perl.
XAMPP is an abbreviation for cross-platform, Apache, MySQL, PHP and Perl, and it allows you to build and run PHP offline, on a local web server on your computer. This simple and lightweight solution works on Windows, Linux, and Mac – hence the “cross-platform” part.
Step 3: Start Apache and MySQL
After installing the XAMPP, you have to run it on your computer. Also make sure you start Apache and MySQL Server. If your Apache and MySQL Server, it will show as the image below.
Step 4: Write HTML, CSS, PHP, SQL code
Now it is the time to write your HTML and PHP files.
Create a separate folder for your website in htdocs folder of XAMPP. You can find your XAMPP in c. (C:\xampp\htdocs). Inside this folder, you have to keep your coding files.
Tip: Your homepage will be known by name: index.html or index.php.
You can create the database for your website through phpmyadmin.
Step 5: Test your website locally on your computer
Keep testing your code in your browser through local host. This is XAMPP comes into handy for this purpose.
Step 6: Deploy your website
When your website is complete. You have to purchase a hosting and a domain for your website. Hosting provider allocates space on a web server for a website to store its files
PHP Website Development…..
When to use index.php instead of index.html?
you will have to choose the PHP extension (.php) when you want php code to be executed in the file. PHP code is code between the opening <?php
or <?
and the closing ?>
tags.
When no PHP code should be executed you can use the .html extension.
Usually when using the .php extension you are telling the web server, that it should use a PHP interpreter to process the file before it will be delivered to the browser. The PHP interpreter will then replace all content between the <?php
and ?>
by the output of the PHP code. Just as if you wrote it manually. The processed file will then be delivered to the browser.
Dr. Sunny is an Assistant Professor in higher education. He has completed his Ph.D. He has a depth of knowledge in the research field and in higher education.