Advertisement

All Free Droid is a great website for finding the latest and greatest apps, gadgets, and tech trends
"author": { "@type": "Person", "name": "Author" } }

How to create website using HTML and Php (Part 1)

 
Have you ever wanted to create websites like Amazon and Facebook? Now you can with All free Droid ! Our step-by-step guide is the perfect way to get started in web development. With our easy-to-follow instructions, you'll be able to create your own website from scratch using HTML and PHP. With All free droid, you'll be able to turn your ideas into reality in no time!




Ok, so we will start from php

 Hello every one many of people are wants to create their own website but lack of knowledge they are confused where to start how to start.

So we will discuss the every step where we can create any project like social media, online shopping, Hotel management and so on.

How to start

As we know that php is a server site scripting language, which means php codes are run only on server. So that we have to bulid our PC or laptop into a server, for that we simply had to install one software name xampp  or also you can use wamp

( I assume that you are know how to install software)


1st step: 

Install Xampp or Wamp. After installing the software go to  C drive you will see a folder call Xampp (if you install Wamp folder name will be Wamp)

Under the folder you will find another folder call htdocs ( in case of Wamp the folder will be www).

Just open the folder and create a new folder . Give the folder name project_name ( whatever your project name)

We have completed our first step.


2nd step:

Open the application you just install and you will see there are some option. You just start the apache and MySQL service.

*Give the permission if they ask

Ok so we just completed our 2nd step. And here we make our computer as a server


Step 3: open you browser ( ex: chrome). And type localhost/project_name on URL and press enter enter.

For now you can't see anything there. But this the URL where your project will be shown.


So now we have to create our first php project

For that we need notepade++ or Dreamweaver. If you don't want to install this type of software you can simply use notepad but for the big project we need IDE 

So just install notepad++ for now

We are all good to go

Most important things to create a website using php

First thing we have two ends front end and back end

Front-end: where user can write , update, filling up form and so on. We will create the front end using HTML, CSS, JAVASCRIPT AND php

Back-end: It is basically a database where whatever user write or fill up etc on frontend, everything is Store on backend (in database)

In php project we are actually deal with database (our backend) so everything user input or get results all are communicating with this database.

Just remember you just need four things remember and you will be expert on php

Php basic commands


1) Select
2) Insert
3) Update
4) Delete

That's it

These are the simple commands, you have to just play with this command.

So what's Select do ? 

When we open flipkart we can see different type of product right. And when we open facebook we can see many photos and post right.

This things is done by this Select command . Actually select command fetch the data from the database(backend) and show it on our page (frontend)
Got it ??
Don't worry we will do the practical also how to use it

So next is 
Insert ,  so insert command is user for inserting the data from the frontend to the database ( backend)
Example: signup form , where we put all our data and info. Everything we enter ilgoes to database and store our info for further use.


Update: As the name suggests update command is user for update data from the database. For example: changing password


Delete: delete command is very simple. This command is user for delete particular data from database.


How to write php code

So in your project folder just create a file and name it index.php, open the in Notepad++ or any IDE .


We are going to write our first php program


<?php


echo " This is my first page ";

?>


Here <?php    is the opening tag,  our browser will know that under this tag everything is php code.

echo  is use for display in frontend. Whatever we write in echo user will see it.


How to run php file

Go to your browser and type localhost/project_name in the URL Bar and you will see


This is my first page



Which is we wrote in echo. Thats it
So now we know that how to display any string or number in php


This is very basic we need to do some advance code.


Post a Comment

0 Comments