Friday, June 30, 2017

Introduction to PHP-MySQL

Introduction

PHP is a server side scripting language, and is a powerful tool for making dynamic and interactive Web pages quickly. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is basically used for developing web based software applications.
PHP is easy to learn and implement. As per W3tech (Web Technology Surveys) PHP is used by 82.0% of all the websites whose server-side programming language we know. Current version number of PHP is 5. Version 5 is used by 97.8% of all the websites who use PHP.
Some of the popular sites developed using PHP are Facebook.com, Baidu.com, Wikipedia.org, Wordpress.com, Tmall.com, Taobao.com etc
PHP is an acronym for "PHP: Hypertext Preprocessor", it is free to download and use.
If PHP is your first server side scripting language to learn, you might be unaware with the web architecture, its terminologies and related needful languages and technologies. Not to worry, this course is designed to give you in depth knowledge of web application development. You will learn all the languages and terminologies that are needful to execute a web application.
We will start with the basic terminologies. Next we will learn HTML, CSS, Javascript, Jquery, PHP and MySQL. Later we will learn how to implement popular and common tasks of any web applications such as login page, session tracking, Ajax, hit counter, form validation, interacting with database etc.
Reader must have exposure to at least one programming language preferably C language. It will help you to understand programming concepts.

What is Client-Server Architecture?

The client–server model of computing is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients.
When we access any website via internet, a software called web browser (chrome, firefox etc) can be used to make request to the computer where desired resource (web page) resides. A software running on destination computer called web server (Apache, IIS etc) extract needful page return back to us as a response to our request. In such scenario, your machine is called client machine and destination machine is known as Server machine. Web browser is client and web server is server.
The job of client is to make request for some resource stored on some other machine which must be connected to our machine via internet or with the help of simple networking. On the other side web server’s job is to receive client’s request, process the request and respond with returning desired page or any error message.


Website

* Web site is a collection of related web pages containing images, videos or other digital assets.
* A web site is hosted at least on one web server accessible via network such as the internet or local area network (LAN) through an internet address known as a uniform resource locator.
* All the publicly accessible websites collectively constitute the World Wide Web 

Web Page

* A web page is a plain text document with formatting instructions of Hyper Text Markup Language (HTML), which is interpreted by Web browser.
* Web pages are transported and accessed by HyperText Transfer Protocol (HTTP)

Web Hosting

* Web hosting is the storage of your website pages on some server machine.
Web Browser
* A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web
* Each resource on World Wide Web is identified by uniform resource locator (url).
* Examples of browsers are Mozilla Firefox, Google Chrome, Internet explorer, Opera, Safari, etc. 

Web Server

* Web server can refer to either the hardware (the computer) or the software (the computer application) that helps to deliver content that can be accessed through the internet.
* Use of web server is to host web sites, data storage and enterprise applications.
* The primary function of web servers is to deliver web pages on the request to client.
* This means delivery of HTML documents and any additional content that may be included by a document such as images, style sheets and java scripts.
* Apache is the most commonly used web server software (according to Netcraft statistics) and Microsoft's Internet Information Services (IIS) is also commonly used.
Conversation
* A client, commonly a web browser, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource or an error message if unable to do so.
* A website is hosted on a computer system known as a web server, also called an HTTP server, and these terms can also refer to the software that runs on these systems and that retrieves and delivers the web pages in response to requests from the website users.
One conversation means HTTP request from browser and HTTP response back from server 


World Wide Web

* In 1994 Tim Berners-Lee decided to constitute the World Wide Web Consortium (W3C) to regulate the development of the many technologies involved (HTTP, HTML, etc.) through a standardization process.
* www is an application runs on internet
* www was first browser developed by Tim Berners-Lee in 1990

Static Web Page

* A static web page is a web page that is delivered to the user exactly as stored.
* Static web page displays the same information for all users, from all contexts.
* Static web pages are often HTML documents stored as files in the file system and made available by the web server over http.
Dynamic Web Page
* A dynamic web page is generated by some web application.
* Dynamic web page displays user specific content.
* They are generated by program which could be written in PHP.
Application Server
* An application server is a software framework that provides an environment in which applications can run.
* In this course, we will use application server to run php script.
Database Server
* A database server is a computer program that provides database services to other computer programs or computers, as defined by the client server model.
* The term may also refer to a computer dedicated to running such a program.
* Some examples of database servers are Oracle, DB2, SQL server, MySQL 
* The SQL query language is more or less same in all the database servers.

Where does PHP fits in

When the web server receives the request for a dynamic page , it looks up the file extension of the requested web page to determine which server or program should process the request.
For a PHP page, the web server forwards the request to the PHP interpreter, which is running on the web server
The PHP interpreter gets the appropriate PHP script from the hard drive. It also loads any form data that the user submitted. Then, it executes the script. 
As the script executes, it generates a web page as its output. The script may also request data from a database server and use that data as part of the web page it is generating.
When the script is finished, the PHP interpreter passes the dynamically generated web page back to the web server. 
Then, the web server sends the page back to the browser in an HTTP response that includes the HTML for the page.
When the web browser receives the HTTP response, it formats and displays the web page.
Then, the web server sends the page back to the browser in an HTTP response that includes the HTML for the page.
When the web browser receives the HTTP response, it formats and displays the web page.



Home     Next>>

No comments:

Post a Comment