This work is licensed under a Creative Commons

  • Slides: 22
Download presentation
This work is licensed under a Creative Commons Attribution-Share. Alike 4. 0 International License.

This work is licensed under a Creative Commons Attribution-Share. Alike 4. 0 International License. This presentation is released under Creative Commons. A 6 ribute, on 4. 0 License. You are free to use, distribute and modify it , including for commercial purposes, provided you acknowledge the source.

PHP, My. SQL, Perl and CGI

PHP, My. SQL, Perl and CGI

What is PHP Source: https: //www. javatpoint. com/php-tutorial PHP is an open-source, interpreted, and

What is PHP Source: https: //www. javatpoint. com/php-tutorial PHP is an open-source, interpreted, and object-oriented scripting language that can be executed at the server-side. PHP is well suited for web development. Therefore, it is used to develop web applications (an application that executes on the server and generates the dynamic page. ). PHP was created by Rasmus Lerdorf in 1994 but appeared in the market in 1995. PHP 7. 4. 5 is the latest version of PHP which was released April 2020. Some important points need to be noticed about PHP are as followed: • PHP stands for Hypertext Preprocessor. • PHP is an interpreted language, i. e. , there is no need for compilation. • PHP is faster than other scripting languages, for example, ASP and JSP. • PHP is a server-side scripting language, which is used to manage the dynamic content of the website. • PHP can be embedded into HTML. • PHP is an object-oriented language. • PHP is an open-source scripting language. • PHP is simple and easy to learn language.

Why use PHP? PHP is a server-side scripting language, which is used to design

Why use PHP? PHP is a server-side scripting language, which is used to design the dynamic web applications with My. SQL database. • It handles dynamic content, database as well as session tracking for the website. • You can create sessions in PHP. • It can access cookies variable and also set cookies. • It helps to encrypt the data and apply validation. • PHP supports several protocols such as HTTP, POP 3, SNMP, LDAP, IMAP, and many more. • Using PHP language, you can control the user to access some pages of your website. • As PHP is easy to install and set up, this is the main reason why PHP is the best language to learn. • PHP can handle the forms, such as - collect the data from users using forms, save it into the database, and return useful information to the user. For example - Registration form.

PHP Features

PHP Features

Performance: PHP script is executed much faster than those scripts which are written in

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 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. Familiarity with syntax: 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 My. SQL, SQLite, ODBC, etc.

Error Reporting PHP has predefined error reporting constants to generate an error notice or

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. Loosely Typed Language: 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. Web servers Support: 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.

Web Development PHP is widely used in web development nowadays. PHP can develop dynamic

Web Development PHP is widely used in web development nowadays. PHP can develop dynamic websites easily. But you must have the basic the knowledge of following technologies for web development as well. • • • HTML CSS Java. Script Ajax XML and JSON j. Query

My. SQL Source: https: //www. javatpoint. com/mysql-tutorial What is My. SQL? My. SQL is

My. SQL Source: https: //www. javatpoint. com/mysql-tutorial What is My. SQL? My. SQL is currently the most popular database management system software used for managing the relational database. It is open-source database software, which is supported by Oracle Company. It is fast, scalable, and easy to use database management system in comparison with Microsoft SQL Server and Oracle Database. It is commonly used in conjunction with PHP scripts for creating powerful and dynamic server-side or web-based enterprise applications. It is developed, marketed, and supported by My. SQL AB, a Swedish company, and written in C and C++ programming languages. The official pronunciation of My. SQL is not the My Sequel; it is My Ess Que Ell. However, you can pronounce it in your way. Many small and big companies use My. SQL supports many Operating Systems like Windows, Linux, Mac. OS, etc. with C, C++, and Java languages. My. SQL is a Relational Database Management System (RDBMS) software that provides many things, which are as follows: • It allows us to implement the database operations on tables, rows, columns, and indexes. • It defines the database relationship in the form of tables (collection of rows and columns), also known as relations. • It provides the Referential Integrity between rows or columns of various tables. • It allows us to updates the table indexes automatically. • It uses many SQL queries and combines useful information from multiple tables for the end -users.

How My. SQL Works? My. SQL follows the working of Client-Server Architecture. This model

How My. SQL Works? My. SQL follows the working of Client-Server Architecture. This model is designed for the end-users called clients to access the resources from a central computer known as a server using network services. Here, the clients make requests through a graphical user interface (GUI), and the server will give the desired output as soon as the instructions are matched. The process of My. SQL environment is the same as the client-server model.

The core of the My. SQL database is the My. SQL Server. This server

The core of the My. SQL database is the My. SQL Server. This server is available as a separate program and responsible for handling all the database instructions, statements, or commands. The working of My. SQL database with My. SQL Server are as follows: • My. SQL creates a database that allows you to build many tables to store and manipulate data and defining the relationship between each table. • Clients make requests through the GUI screen or command prompt by using specific SQL expressions on My. SQL. • Finally, the server application will respond with the requested expressions and produce the desired result on the client-side. A client can use any My. SQL GUI. But, it is making sure that your GUI should be lighter and user-friendly to make your data management activities faster and easier. Some of the most widely used My. SQL GUIs are My. SQL Workbench, Sequel. Pro, DBVisualizer, and the Navicat DB Admin Tool. Some GUIs are commercial, while some are free with limited functionality, and some are only compatible with Mac. OS. Thus, you can choose the GUI according to your needs.

Reasons of popularity My. SQL is becoming so popular because of these following reasons:

Reasons of popularity My. SQL is becoming so popular because of these following reasons: • My. SQL is an open-source database, so you don't have to pay a single penny to use it. • My. SQL is a very powerful program so it can handle a large set of functionality of the most expensive and powerful database packages. • My. SQL is customizable because it is an open-source database, and the open-source GPL license facilitates programmers to modify the SQL software according to their own specific environment. • My. SQL is quicker than other databases, so it can work well even with the large data set. • My. SQL supports many operating systems with many languages like PHP, PERL, C, C++, JAVA, etc. • My. SQL uses a standard form of the well-known SQL data language. • My. SQL is very friendly with PHP, the most popular language for web development. • My. SQL supports large databases, up to 50 million rows or more in a table. The default file size limit for a table is 4 GB, but you can increase this (if your operating system can handle it) to a theoretical limit of 8 million terabytes (TB).

Perl Source: https: //www. javatpoint. com/perl-tutorial • Perl is a programming language which was

Perl Source: https: //www. javatpoint. com/perl-tutorial • Perl is a programming language which was originally developed for script manipulation. But now Perl is used for a variety of purpose including web development, GUI development, system administration and many more. It is a stable, cross platform programming language. • For web development, Perl CGI is used. CGI is the gateway which interacts with the web browser and Perl in a system. • Its typical use is extracting information from a text file and printing out report for converting a text file into another form. This is because it got its name after the expression, "Practical Extraction and Report Language". • Programs written in Perl are called Perl scripts, whereas system programs to execute Perl scripts are called Perl program. • Perl is an interpreted language. When a Perl program run, it is first compiled into a byte code, then it is converted into machine instructions. So writing something in Perl instead of C saves your time. • It supports most of the operating systems and is listed in Oxford English dictionary. Its concepts and syntax is taken from many languages like awk, bourne shell, C, sed and even English.

Perl History • Perl was developed by Larry Wall in 1987 as a scripting

Perl History • Perl was developed by Larry Wall in 1987 as a scripting language to make report processing easier. • It was first released with version 1. 0 on December 18, 1987. • Perl 2, released in 1988 adding a much better regular expression engine. • Perl 3, released in 1989 adding support for binary data streams. • Perl 4, released in 1991 with a better documentation than earlier. • Perl 5, released on October 17, 1994. It added many new features to its last version like objects, variables, references and modules. • The latest version 5. 24 is released on May 9, 2016.

Perl Features • • • It has a very simple Object-oriented programming syntax. It

Perl Features • • • It has a very simple Object-oriented programming syntax. It is easily extendible as it supports 25, 000 open source modules. It supports Unicode. It includes powerful tools to process text to make it compatible with mark-up languages like HTML, XML. It supports third party database including Oracle, My. SQL and many others. It is embeddable in other systems such as web servers and database servers. It is open source software licensed under GNU. Many frameworks are written in Perl. It can handle encrypted web data including e-commerce transactions. It is a cross platform language. It offers a regular expression engine which is able to transform any type of text.

What is CGI ? Source: https: //www. tutorialspoint. com/perl_cgi. htm • • The Common

What is CGI ? Source: https: //www. tutorialspoint. com/perl_cgi. htm • • The Common Gateway Interface, or CGI, is a set of standards that define how information is exchanged between the web server and a custom script. The CGI specs are currently maintained by the NCSA and NCSA defines CGI is as follows − The Common Gateway Interface, or CGI, is a standard for external gateway programs to interface with information servers such as HTTP servers. The current version is CGI/1. 1 and CGI/1. 2 is under progress. Web Browsing • To understand the concept of CGI, lets see what happens when we click a hyper link to browse a particular web page or URL. • Your browser contacts the HTTP web server and demand for the URL ie. filename. • Web Server will parse the URL and will look for the filename in if it finds that file then sends back to the browser otherwise sends an error message indicating that you have requested a wrong file. • Web browser takes response from web server and displays either the received file or error message.

 • However, it is possible to set up the HTTP server so that

• However, it is possible to set up the HTTP server so that whenever a file in a certain directory is requested that file is not sent back; instead it is executed as a program, and whatever that program outputs is sent back for your browser to display. This function is called the Common Gateway Interface or CGI and the programs are called CGI scripts. These CGI programs can be a PERL Script, Shell Script, C or C++ program etc.

CGI Architecture Diagram

CGI Architecture Diagram

Web Server Support & Configuration Before you proceed with CGI Programming, make sure that

Web Server Support & Configuration Before you proceed with CGI Programming, make sure that your Web Server supports CGI and it is configured to handle CGI Programs. All the CGI Programs be executed by the HTTP server are kept in a pre-configured directory. This directory is called CGI Directory and by convention it is named as /cgi-bin. By convention PERL CGI files will have extention as. cgi.

CGI with Single Request

CGI with Single Request

CGI with Multiple Request

CGI with Multiple Request

Creating HTML Pages Dynamically • HTML • Java. Script • CSS

Creating HTML Pages Dynamically • HTML • Java. Script • CSS