Server-side
scripting using PHP
A scripting language is a kind of web-based programming
language for solving web-related problems. Examples of server-side scripting
languages are PHP, python, ruby, etc.
Server-side scripting
is a method of designing websites. They are generally used to create dynamics
websites. They are generally used to create dynamics web pages. This means that
the page displayed to the user doesn’t exist as a document in a server in its
own right and is only brought to the existence in response to the user's request.
Therefore, server-side scripting is a block of program code that executes on a web
server computer.
Following are the reasons we use PHP for server-side scripting:
· It is embedded in Html.
· It is used to manage dynamic contents, databases, session tracking, etc.
Introduction to PHP
PHP originally stood for personal web pages but now it is understood as PHP Hypertext pre-processor where any person request for any PHP page in the address bar of the browser that request is first sent to the server interprets PHP file and return back response in the form of HTML. That’s why it is called a hypertext pre-processor.
Features of PHP
Following are the features of PHP:
· The syntax of PHP is similar to C. So, it is easy to learn and use.
· · We can open, create, read, write and close files.
· · We can add, delete and modify elements within our database in our database.
· · It can encrypt data.
PHP file
PHP file contains text, html, CSS, JavaScript and PHP code. PHP file has extension .PHP.
Hardware requirements:
Following are the hardware requirements:
· 1GHZ CPU processor
· 2 GB ram
· 1 GB hard disk
Software requirements:
You need to be running PHP 5.4+ on the webserver. The software has been deployed successfully on both Apache and IIS web servers and tested with MYSQL, Maria DV, and MS-SQL server's database at the back end.
Data types of PHP
PHP data
types are used to hold different types of data or values. PHP support 8
primitives data types that can be categorized further into 3 types.
·
Scalar
type
·
Compound
type
·
Special
type
1. Scalar type
It holds only single
values. Its types are:
·
Boolean
·
Integer
·
Float
·
String
2. Compound type
It can hold multiple
values. Its types are:
·
Array
·
Object
3. Special type
Its types are:
·
Resource
·
Null
WAP to reverse a number using PHP:
Connecting server-side scripting to database:
Create a MySQL database
Create a MySQL table
Bro output pani xa vane send gardauna na smarttips456@gmail.com ma
ReplyDelete