Class-7-Introduction To PHP Scripting-Server and Client Side XAMPP CSS HTML JavaScript SCripting Languages
Class-7-Introduction To PHP Scripting-Server and Client Side XAMPP CSS HTML JavaScript SCripting Languages
Th
e scripts can be written in two forms, at the server end (back end) or at the client end (front end).
The main difference between server-side scripting and client-side scripting is that the server side
scripting involves server for its processing. On the other hand, client-side scripting requires
browsers to run the scripts on the client machine but does not interact with the server while
processing the client-side scripts.
Comparison Chart
Basis for
Server-side scripting Client-side scripting
comparison
Basic Works in the back end which could Works at the front end and script
not be visible at the client end. are visible among the users.
Processing Requires server interaction. Does not need interaction with the
server.
Languages PHP, ASP.net, Ruby on Rails, HTML, CSS, JavaScript, etc.
involved ColdFusion, Python, etc.
Affect Could effectively customize the web Can reduce the load to the server.
pages and provide dynamic websites.
Security Relatively secure. Insecure
Server-side scripting : Any scripting or programming that can run on the web server is
known as server-side scripting. The operations like customization of a website, dynamic change
in the website content, response generation to the user’s queries, accessing the database, and so
on are performed at the server end.
The server-side scripting constructs a communication link between a server and a client (user).
Earlier the server side scripting is implemented by the CGI (Common Gateway
Interface) scripts. The CGI was devised to execute the scripts from programming languages
such as C++ or Perl on the websites.
The server-side involves three parts: server, database, API’s and back-end web software
developed by the server-side scripting language. When a browser sends a request to the server
for a webpage consisting of server-side scripting, the web server processes the script before
serving the page to the browser. Here the processing of a script could include extracting
information from a database, making simple calculations, or choosing the appropriate content
that is to be displayed in the client end. The script is being processed and the output is sent to the
browser. The web server abstracts the scripts from the end user until serving the content, which
makes the data and source code more secure.
PHP: It is the most prevalent server-side language used on the web which was designed to
extract and manipulate information in the database. The language is used in association with
SQL language for the Database. It is used in Facebook, WordPress and Wikipedia.
Python: The language is fast and contains shorter code. It is good for beginners as it
concentrates on the readability and simplicity of the code. Python functions well in the object-
oriented environment and used in famous sites like Youtube, Google, etc.
Ruby: It contains complex logic which packages the back-end with database utility which can
also be provided by PHP and SQL.
Client-side Scripting :Client-side scripting is performed to generate a code that can run
on the client end (browser) without needing the server side processing. Basically, these types of
scripts are placed inside an HTML document. The client-side scripting can be used to examine
the user’s form for the errors before submitting it and for changing the content according to the
user input.
The effective client-side scripting can significantly reduce the server load. It is designed to run
as a scripting language utilizing a web browser as a host program. For example, when a user
makes a request via browser for a webpage to the server, it just sent the HTML and CSS as plain
text, and the browser software in the client’s computer interprets and displays the web content on
the client’s computer.
Client-side scripting languages:
HTML: It is the fundamental building blocks of web programming which provides the frame to
the website. It describes the arrangement of the content.
CSS: CSS provides the way to design the graphic elements which help in making the appearance
of the web application more attractive.
JavaScript: It is also a client-side scripting language which essentially devised for the specific
purpose, but currently there are various JavaScript frameworks used as server-side scripting
technology.
1. Server-side scripting is used at the backend, where the source code is not viewable or
hidden at the client side (browser). On the other hand, client-side scripting is used at the
front end which users can see from the browser.
2. When a server-side script is processed it communicates to the server. As against, client-side
scripting does not need any server interaction.
3. The client-side scripting language involves languages such as HTML, CSS and JavaScript.
In contrast, programming languages such as PHP, ASP.net, Ruby, ColdFusion, Python, C#,
Java, C++, etc.
4. Server-side scripting is useful in customizing the web pages and implements the dynamic
changes in the websites. Conversely, the client-side script can effectively minimize the load
to the server.
5. Server-side scripting is more secure than client-side scripting as the server side scripts are
usually hidden from the client end, while a client-side script is visible to the users.
Conclusion
Client-side scripting and server-side scripting works in a coordinated manner with each other.
However, both the scripting techniques are very different, where the client-side scripting
emphasize on making the interface of the web application or website more appealing and
functional. Conversely, server-side scripting emphasizes on the data accessing methods, error
handling and fast processing etc.
Model Questions.
XAMPP
XAMPP is an open source software developed by Apache friends. The use of XAMPP is to test
the client’s website (ie. a site developed in the developer’s computer) before uploading it to the
remote web server. XAMPP server software gives the suitable environment for testing MYSQL,
PHP, Apache and Perl projects on the local computer.
XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP (P) and Perl (P).
It is a simple, lightweight Apache distribution that makes it extremely easy for developers to
create a local web server for testing purposes. Everything you need to set up a web server –
server application (Apache), database (MySQL), and scripting language (PHP) – is included in a
simple extractable file.
XAMPP is also cross-platform, which means it works equally well on Linux, Mac and Windows.
Since most actual web server deployments use the same components as XAMPP, it makes
transitioning from a local test server to a live server is extremely easy as well. Web development
using XAMPP is especially beginner friendly.
What’s Included in XAMPP?
XAMPP has four primary components. These are:
1. Apache: Apache is the actual web server application that processes and delivers web content
to a computer. Apache is the most popular web server online, powering more than 60% of all
websites.
Apache is an open-source and free web server software. The official name is Apache HTTP
Server, and it’s maintained and developed by the Apache Software Foundation.
When someone wants to visit a website, they enter a domain name into the address bar of their
browser. Then, the web server delivers the requested files by acting as a virtual delivery man.
The job of a web server is to serve websites on the internet. To achieve that goal, it acts as a
middleman between the server machines and client machines. It pulls content from the server on
each user request and delivers it to the web.
2. MySQL: Every web application, howsoever simple or complicated, requires a database for
storing collected data. MySQL, which is open source, is the world’s most popular database
management system. It powers everything from hobbyist websites to professional platforms like
WordPress (Content Management System).
3. PHP: PHP stands for Hypertext Preprocessor. It is a server-side scripting language that
powers some of the most popular websites in the world, including WordPress and Facebook. It is
open source, relatively easy to learn, and works perfectly with MySQL, making it a popular
choice for web developers.
4. Perl: Perl is a, general-purpose high-level programming language originally developed for text
manipulation and now used for a wide range of tasks including system administration, web
development, network programming, GUI development, and more.
HTML
HTML is not a programming language. HTML was invented by Tim Berners-Lee. He came
up with the idea of an Internet-based hypertext system.
Hypertext means a text that contains references (links) to other texts that viewers can access
immediately.
HTML documents are files that end with a .html or .htm extension. You can view then using
any web browser (such as Google Chrome, Safari, or Mozilla Firefox). The browser reads the
HTML file and renders its content so that internet users can view it.
Each HTML page consists of a set of tags (also called elements), which you can refer to as
the building blocks of web pages. They create a hierarchy that structures the content into
sections, paragraphs, headings, and other content blocks.
Most HTML elements have an opening and a closing that use the <tag></tag> syntax.
Below, you can see a code example of how HTML elements can be structured:
<div>
<h1>The Main Heading</h1>
<h2>A catchy subheading</h2>
<p>Paragraph one</p>
<img src="/" alt="Image">
<p>Paragraph two with a <a href="https://example.com">hyperlink</a></p>
</div>
The outmost element is a simple division (<div></div>) you can use to mark up bigger
content sections.
It contains a heading (<h1></h1>), a subheading (<h2></h2>), two paragraphs
(<p></p>), and an image (<img>).
The second paragraph includes a hyperlink (<a></a>) with a href attribute that contains the
destination URL.
The image tag also has two attributes: src for the image path and alt for the image
description.
Overviewing The Most Used HTML Tags
HTML tags have two main types: block-level and inline tags.
Block-level elements take up the full available space and always start a new line in the
document. Headings and paragraphs are a great example of block tags.
Inline elements only take up as much space as they need and don’t start a new line on the
page. They usually serve to format the inner contents of block-level elements. Links and
emphasized strings are good examples of inline tags.
Block-Level Tags
The three block level tags every HTML document needs to contain are <html>, <head>,
and <body>.
The <html></html> tag is the highest level element that encloses every HTML page.
The <head></head> tag holds meta information such as the page’s title and charset.
Finally, the <body></body> tag encloses all the content that appears on the page.
<html>
<head>
<!-- META INFORMATION -->
</head>
<body>
<!-- PAGE CONTENT -->
</body>
</html>
Headings have 6 levels in HTML. They range from <h1></h1> to <h6></h6>, where h1 is
the highest level heading and h6 is the lowest one. Paragraphs are enclosed by <p></p>,
while blockquotes use the <blockquote></blockquote> tag.
Divisions are bigger content sections that typically contain several paragraphs, images,
sometimes blockquotes, and other smaller elements. We can mark them up using
the <div></div> tag. A div element can contain another div tag inside it as well.
You may also use <ol></ol> tags for ordered lists and <ul></ul> for unordered ones.
Individual list items must be enclosed by the <li></li> tag. For example, this is how a basic
unordered list looks like in HTML:
<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>