Module 1 Web Systems and Technology 2
Module 1 Web Systems and Technology 2
MELENDRES
C. CONTENT
processing instructions <?php and ?> that allow you to jump into and out of "PHP
mode." Figure 1.2 Sample PHP Script
The best things in using PHP are that it is extremely simple for a newcomer, but
offers many advanced features for a professional programmer.
Brief History of PHP
Through the years, PHP is the premium choice of developers for developing web applications. Thanks to Rasmus Lerdorf, who back in
1994, conceived the idea of PHP. Working through it, he later made its first ever version public in 1995 known as PHP/FI. At that time,
it
was just a simple PERL/CGI script toolset written in C language. The language evolved quickly after the release of PHP3 in 1998,
which included several advanced features – most importantly – the introduction of Zend engine. Today, PHP has found its usage in
many leading organizations for handling their online portfolio. These big guns include Facebook, Wikipedia, Yahoo, WordPress and
others, while the numbers are still growing.
3|Web System and Technologies 2 Lecture Note
Lesson 1|Prepared by: URIEL M. MELENDRES
framework. The latest updates are released timely by the PHP to make it better for the developer to develop the web-based
applications.
8. Testing
PHP based web applications can be easily tested. PHP unit uses to perform the unit testing quickly and easily. It also helps the
programmers to write test cases and perform the testing smoothly. For PHP based web applications, the developers do not need to
write the additional code. PHP frameworks help in automating the different tasks.
9. Security
PHP frameworks built-in feature and tools make it easier to protect the web applications from the outer attacks and security threats.
The security threats can be like SQL injection, data tampering, and forgery etc. To protect from these security threats, developers used
PHP frameworks for developing web applications.
10. Stable
PHP is also stable as compared to other programming languages. It has been in existence for a long time. The developers have
worked on PHP to make it easy for the programmers to work on developing the PHP web-based applications. They have fixed the
issues and bugs over the period of time for the different version of PHP and make it very stable.
What are the applications of PHP?
There are wide applications of PHP in several digital platforms. Now we are going to provide you some of the important applications of
PHP programming language in different fields with their brief information.
1. Web Pages and Web-Based Applications:
Any web page or web application developed in the current ecosystem needs to offer a high degree of customization, provide highly
interactive user interface, be capable of performing online transactions and integrate with database systems. Through its three-tiered
architecture which works on browser, server and database system in a linear manner, PHP offers a reliable solution to achieve these
features. As a consequence, PHP is used by over 82% of websites for server side programming; over 244 million websites are built
using PHP. Further, web-based enterprise applications and a multitude of Facebook apps are also scripted in PHP.
2. Web Content Management Systems:
PHP offers support to numerous databases including MySQL, Oracle and MS Access and is capable of interacting with other services
using protocols such as IMAP, LDAP, POP3, NNTP, SNMP, HTTP and COM . As a result, PHP has been used for creating popular
web Content Management Systems (CMS), including WordPress and its plugins, user-facing portion of Facebook, Joomla, Drupal,
Moodle, Silverstripe, MediaWiki, Digg and others.
3. eCommerce Applications:
From small businesses to large enterprises, selling to online shoppers is now an indispensable requirement. Through use of
frameworks like CodeIgniter and CakePHP, PHP allows creation of eCommerce applications in a swift and simple manner. Many of the
highly used eCommerce platforms, such as OpenCart, Magento, PrestaShop, Zen Cart, AgoraCart and Ubercart, have all been created
on PHP.
4. GUI-Based Applications:
While PHP is largely used as a scripting language for web-based applications, it is also possible to employ it for creating desktop
graphical user interface (GUI) based applications. Tools like PHP-GTK 2, DevelStudio and ZZEE PHP GUI, allow scripting in PHP,
compiling it into .exe capable of running standalone.
5. Create Flash:
5|Web System and Technologies 2 Lecture Note
Lesson 1|Prepared by: URIEL M. MELENDRES
An open source library, such as Ming, helps to create .SWF format movies which include most of the features of Flash – gradients,
bitmaps (pngs and jpeg), morphs, shapes, text, button, actions and animations. Further, Flash elements like login-form and email form
can be easily created and incorporated into dynamic web pages using PHP.
6. Image Processing and Graphic Design:
Apart from managing text content, PHP can also be used to manipulate images. Integration of various image processing libraries, such
as GD library, Imagine and ImageMagick, in PHP applications allows rotating, cropping, resizing, creating thumbnail pictures, adding
watermarks and generating output images in multiple formats including jpeg, gif, wbmp, xpm and png. This feature is an essential
requirement for building robust websites and web applications.
7. Data Representation:
Through use of tools like Image_Graph, PHP can be used to create a variety of graphs, charts, scatter-dot plots and other means of
graphical representations. This feature finds application across client-side desktop applications, eCommerce websites and other
applications where data needs to be presented in a concise and graphical manner.
8. Creating PDF Files:
Further, by use of a library called PDFLib, PHP can be used to generate PDF files. This can facilitate the creation of an online invoicing
system where an HTML-driven invoice is created in PDF format.
1.2 Introducing XAMPP and WAMPP
What you need to run PHP?
To run PHP code, you need the following three software on your local machine:
1. Web Server. A web server is a computer that runs websites. It's a computer program that distributes web pages as they are
requisitioned. The main job of a web server is to display the website content. The most commonly used web server is Apache,
an open-source and free web server software that powers around 40% of websites around the world. The official name is
Apache HTTP Server, and it’s maintained and developed by the Apache Software Foundation.
2. PHP (Interpreter). PHP is an interpreted language. This means that you will write code statements (lines of code) and when a
page is requested, the PHP interpreter will load your PHP code, parse it and then execute it.
3. Database Software (optional). Database software is designed to create databases and to store, manage, change, search, and
extract the information contained within them. A comprehensive database software program is sometimes called a database
management system. MySQL is the most popular database system used with PHP.
You can separately install Web Server, PHP Interpreter, and databases, but to make work easier, developers have made all in one
setup package that will automatically install and set up PHP environment on your Windows, Linux or MAC machines. There following
are the four common web server solution package used:
Figure 1.5 Official Website where you can download the latest
version of WAMP.
It is easy to create PHP file, it is just the same way you create HTML file. If you are using Notepad++, just click File>Save As and
choose PHP Hypertext Preprocessor file like what shown in the Figure 1.24. It is suggested that before start writing PHP script, you
should save it to identify what kind of codes you are writing. The default file extension for PHP files is ".php". A PHP file normally
contains HTML tags, and some PHP scripting code.
called statements. Figure 1.25 shows an script that contains single statement that writes the text “Hello World!” to a web browsers
windows using an echo statement.
Even though PHP Group officially recommends to use standard PHP script delimiters to write PHP, some Web developers prefer the
other types of codes declaration blocks, so you must be able to recognize the other delimiters when you them.
What is the syntax of the other delimiters?
Figure 1.25 Using ‘echo’ statement
The <script> element
When the script element is used with PHP, you must assign a value of “php” to the
<script language="php">
language attribute of the <script> like what shown in Figure 1.26. Like the standard
echo "Hello World!"; PHP script delimiters, the <script> element is always available on any Web server
</script> that support PHP. Unfortunately, the <script element’s language attribute
deprecated in XHTML, as a result you cannot validate documents that include PHP
Figure 1.26 Sample code using <script> <script> elements.
element
Short PHP Script Delimiters
A simplified method of writing PHP code declaration blocks is to use the short
<?
script like what shown in Figure 1.27. Although it is simple and short, the major
echo "Hello World!"; drawback of this delimiter is it is not available in all webserver unlike the standard
?> and <script>. That’s why the PHP Group discourages the use of short delimiters,
Figure 1.27 Sample Short PHP script especially when it redistributed and used by others.
ASP-Style Script Delimiters
The ASP-style delimiters is similar to short PHP, the only difference is the
<% question mark was replaced by percent symbol like what shown in Figure 1.28.
echo "Hello World!"; ASP-style script can also ne enabled or disabled in the php.ini configuration file,
%> so you should not use them unless you are sure they are enabled on any Web
Figure 1.28 Sample ASP-style script servers on which PHP script will run.
E. Assessment
REFERENCES
https://techdifferences.com/difference-between-server-side-scripting-and-client-side-scripting.html
https://www.fasthosts.co.uk/blog/client-side-vs-server-side-scripting/
https://www.php.net/manual/en/intro-whatis.php
https://www.educba.com/advantages-of-php/
https://www.cloudways.com/blog/php-version-history/
https://www.invensis.net/blog/applications-php-programming-language/
https://www.w3trainingschool.com/applications-php-programming-language
https://economictimes.indiatimes.com/definition/web-server
https://www.w3schools.in/php/install/
https://www.hostinger.ph/tutorials/what-is-apache
https://stillat.com/blog/2014/04/02/how-does-php-work-with-the-web-server-and-browser
https://www.quickbase.com/articles/database-software-basics
https://www.w3schools.com/php/php_mysql_intro.asp
https://blog.templatetoaster.com/how-to-install-wamp/
https://www.wikihow.com/Install-WAMP
https://www.w3schools.com/php/php_syntax.asp
https://www.apachefriends.org/download.html
https://www.wikihow.com/Install-XAMPP-for-Windows
https://www.wikihow.com/Set-up-a-Personal-Web-Server-with-XAMPP
https://tutorialsclass.com/faq/is-php-a-case-sensitive-language/
Gosselin, D., Kokoska, D., & Easterbrooks, R., 2011, “PHP Programming with MySQL”. Cengage Learning
and instructor with ease? contact; no introduction; one mispronounced work; made audience; introduced self and
mispronounced a few words; eye contact; introduced self and project. Responded easily to
long pauses; somewhat project. Respond to questions. questions.
confused.
Source: https://www.dit.ie/media/teachertraining/case0023-digitalmultimedia/Evaluation%20Rubric%20for%20Video
%20Production.docx