Difference Between Client
Difference Between Client
Its main function is to provide the requested output to the end Its primary function is to manipulate and provide access to the respective database
user. as per the request.
It does not provide security for data. It provides more security for data.
It is a technique used in web development in which scripts run It is a technique that uses scripts on the webserver to produce a response that is
on the client’s browser. customized for each client’s request.
HTML, CSS, and javascript are used. PHP, Python, Java, Ruby are used.
No need of interaction with the server. It is all about interacting with the servers.
It reduces load on processing unit of the server. It surge the processing load on the server.
Features Server-side Scripting Client-side Scripting
Primary The main function of this scripting is to manipulate and grant The main purpose of this scripting is to give the
Function access to the requested database. requested output to the end-user.
Uses It is employed at the backend, where the source code is invisible It is utilized at the front end, which users may view
or concealed on the client side. through the browser.
Security It is more secure while working on a web app. It is less secure than server-side scripting due to the
code accessibility offered to the client.
Running It executes on the web server. It executes on the remote computer system.
Dependability It doesn't depend on the client. It depends on the user's browser version.
File Access It offers complete access to the file that is stored in the web It doesn't offer any access to the files on the web servers.
database server.
Code Allowance It enables the backend developer to hide the source code from The user is given access to the written code after
the user. confirming their requirements.
Occurrence It only responds after the user begins the browsing request. It happens when the browser processes all of the codes
and then acts according to the client's needs.
Affect It may reduce the server load. It may effectively customize web pages and offer
dynamic websites.
Languages The server-side scripting programming languages, such as PHP, Its programming languages are HTML, CSS, and
Involved ColdFusion, Python, ASP.net, Java, C++, Ruby, C#, etc. JavaScript.
EVALUATION OF PHP
The term PHP is an acronym for PHP: Hypertext Preprocessor. PHP is a server-side scripting language designed
specifically for web development. It is open-source which means it is free to download and use. It is very simple to
learn and use. The files have the extension “.php”.
Rasmus Lerdorf inspired the first version of PHP and participated in the later versions. It is an interpreted language
and it does not require a compiler.
• PHP code is executed in the server.
• It can be integrated with many databases such as Oracle, Microsoft SQL Server, MySQL, PostgreSQL, Sybase, and
Informix.
• It is powerful to hold a content management system like WordPress and can be used to control user access.
• It supports main protocols like HTTP Basic, HTTP Digest, IMAP, FTP, and others.
• Websites like www.facebook.com and www.yahoo.com are also built on PHP.
• One of the main reasons behind this is that PHP can be easily embedded in HTML files and HTML codes can also
be written in a PHP file.
• The thing that differentiates PHP from the client-side language like HTML is, that PHP codes are executed on the
server whereas HTML codes are directly rendered on the browser. PHP codes are first executed on the server
and then the result is returned to the browser.
• The only information that the client or browser knows is the result returned after executing the PHP script on
the server and not the actual PHP codes present in the PHP file. Also, PHP files can support other client-side
scripting languages like CSS and JavaScript.
PHP Features
PHP is very popular language because of its simplicity and open source. There are some important features of
PHP given below:
Performance:
PHP script is executed much faster than those scripts which are written in other languages such as JSP and
ASP. PHP uses its own memory, so the server workload and loading time is automatically reduced, which results
in faster processing speed and better performance.
Open Source:
PHP source code and software are freely available on the web. You can develop all the versions of PHP
according to your requirement without paying any cost. All its components are free to download and use.
PHP has easily understandable syntax. Programmers are comfortable coding with it.
Embedded:
PHP code can be easily embedded within HTML tags and script.
Platform Independent:
PHP is available for WINDOWS, MAC, LINUX & UNIX operating system. A PHP application developed in one
OS can be easily executed in other OS also.
Database Support:
PHP supports all the leading databases such as MySQL, SQLite, ODBC, etc.
Error Reporting -
PHP has predefined error reporting constants to generate an error notice or warning at runtime. E.g., E_ERROR,
E_WARNING, E_STRICT, E_PARSE.
PHP allows us to use a variable without declaring its datatype. It will be taken automatically at the time of
execution based on the type of data it contains on its value.
PHP is compatible with almost all local servers used today like Apache, Netscape, Microsoft IIS, etc.
Security:
PHP is a secure language to develop the website. It consists of multiple layers of security to prevent threads
and malicious attacks.
Control:
Different programming languages require long script or code, whereas PHP can do the same work in a few
lines of code. It has maximum control over the websites like you can make changes easily whenever you want.
A Helpful PHP Community:
It has a large community of developers who regularly updates documentation, tutorials, online help, and FAQs.
Learning PHP from the communities is one of the significant benefits.
Basic Syntax:-
All PHP code goes between the php tag. It starts with <?php and ends with ?>. The syntax of PHP
tag is given below:
1. <?php
2. //your code here
3. ?>
Let's see a simple PHP example where we are writing some text using PHP echo command.
File: first.php
<!DOCTYPE>
<html>
<body>
<?php
echo "<h2>Hello First PHP</h2>";
?>
</body>
</html>
Output:
1. <?php
2. $str="hello string";
3. $x=200;
4. $y=44.6;
5. echo "string is: $str <br/>";
6. echo "integer is: $x <br/>";
7. echo "float is: $y <br/>";
8. ?>
Output:
string is: hello string
integer is: 200
float is: 44.6
PHP Constants
PHP constants are name or identifier that can't be changed during the execution of the script except for magic
constants, which are not really constants. PHP constants can be defined by 2 ways:
1. <?php
2. define("MESSAGE","Hello JavaTpoint PHP");
3. echo MESSAGE;
4. ?>
Output:
Hello JavaTpoint PHP