Web and Internet Technical Report

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

NAME - ARYAN RAJ

ROLL NO. - 18700120047

SUBJECT - Web and Internet


Technology(PECCS801D)

TOPIC - CGI Script, Java Script, CSS, XML,


XHTML

BRANCH - CSE 4TH YEAR

SEMESTER - 8TH
CGI SCRIPT

Abstract
A CGI script, or Common Gateway Interface script, is a program that runs on a web server to process
data. CGI scripts are often written in scripting languages like Perl, Tcl, C, or C++. They may also include
compiled programs. A CGI script, or Common Gateway Interface script, is a program that runs on a web
server to process data. CGI scripts are often written in scripting languages like Perl, Tcl, C, or C++. They
may also include compiled programs.

Note:
The CGI library was a Python library that provided a simple interface for writing CGI scripts (scripts
that run on a web server).
This library has been deprecated in favor of more modern and feature-rich alternatives, such as the
web framework Django.

Features of CGI:

It is a very well-defined and supported standard.

CGI scripts are generally written in languages such as Perl, C, or shell scripts. For example,
a simple Perl script could be used to process form data submitted from a web page and
generate a dynamic response.

CGI allows applications to interface with HTML, enabling dynamic content generation for
web pages. For example, a CGI script can be used to fetch data from a database and
generate dynamic HTML content for display on a web page.

CGI is the best method to create a counter because it is currently the quickest.

CGI standard is generally the most compatible with today’s browsers.

Advantages of CGI:
Quick implementation: CGI can be a quick and straightforward method for implementing simple web-
based tasks, such as form processing or data manipulation. For example, a CGI script can be quickly
developed and deployed to process user input from a web form and generate a response.

Easy to use existing code: There is a large existing code base of CGI scripts, especially in Perl, which can
be readily used or customized for specific requirements. For example, there are numerous CGI scripts
available for tasks such as form processing, data validation, and file uploads.
Well-defined and supported standard.
CGI-based counters and CGI code to perform simple tasks are available in plenty.

Disadvantages of CGI:
Overhead in page loads: Each page load in CGI incurs overhead by having to load the script into
memory, which can impact performance, especially in high-traffic websites. For example, if a website
receives a large number of requests, the overhead of loading the CGI script for each request can
result in slower response times.

Limited caching capabilities: CGI scripts do not easily allow for caching of data in memory between
page loads, which can affect performance and scalability. For example, if a website requires frequent
database queries or other resource-intensive tasks, CGI may not be the best choice due to limited
caching capabilities.

Security: Since CGI scripts are executed on the server, there is always a risk of security vulnerabilities.
For example, if the script does not properly validate user input, it may be vulnerable to SQL injection
attacks.

Scalability: CGI is not well-suited for handling large volumes of traffic or requests. As the number of
requests increases, the performance of the server may suffer, leading to slower response times or
even crashes.

Alternatives to CGI:
FastCGI:
FastCGI is a variation of CGI that is designed to improve performance and scalability. It allows the
web server to keep the CGI program running in memory, reducing the overhead of loading it for each
request.
PHP:
PHP is a popular server-side scripting language that is widely used for web development. It is
designed to be embedded in HTML pages and can be used to generate dynamic content.
Java Servlets:
Java Servlets are Java-based alternatives to CGI that are designed to be more scalable and efficient.
They can handle large volumes of traffic and can be used to generate dynamic content.
Web Frameworks:
Web frameworks like Django, Ruby on Rails, and Flask provide a more structured and efficient way to
develop web applications. They abstract away many of the low-level details of web development and
provide features like URL routing, templating, and database integration.
Java Script
JavaScript is a scripting or programming language that allows you to implement complex features on
web pages — every time a web page does more than just sit there and display static information for
you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics,
scrolling video jukeboxes, etc.

Features of JavaScript

According to a recent survey conducted byStack Overflow, JavaScript is the most popular language on
earth.
With advances in browser technology and JavaScript having moved into the server with Node.js and
other frameworks, JavaScript is capable of so much more.

Here are a few things that we can do with JavaScript:

JavaScript was created in the first place for DOM manipulation. Earlier websites were mostly static,
after JS was created dynamic Web sites were made.

Functions in JS are objects. They may have properties and methods just like other objects. They can be
passed as arguments in other functions.

Can handle date and time.

Performs Form Validation although the forms are created using HTML.

No compiler is needed.

Is JavaScript Compiled or Interpreted or both ?

JavaScript is both compiled and interpreted. In the earlier versions of JavaScript, it used only the
interpreter that executed code line by line and shows the result immediately. But with time the
performance became an issue as interpretation is quite slow. Therefore, in the newer versions of JS,
probably after the V8, the JIT compiler was also incorporated to optimize the execution and display the
result more quickly. This JIT compiler generates a bytecode that is relatively easier to code. This
bytecode is a set of highly optimized instructions.
The V8 engine initially uses an interpreter, to interpret the code. On further executions, the V8 engine
finds patterns such as frequently executed functions, and frequently used variables, and compiles them
to improve performance.

JavaScript is best known for web page development but it is also used in a variety of non-browser
environments.
css
CascadingStyleSheets, fondly referred to asCSS, is a simply designed language intended to simplify the
process of making web pages presentable. CSS allows you to apply styles to web pages. More
importantly, CSS enables you to do this independently of the HTML that makes up each web page.

While HTML uses tags, CSS uses rulesets. CSS is easy to learn and understand, but it provides powerful
control over the presentation of an HTML document.

Why CSS?

CSS saves time:You can write CSS once and reuse the same sheet in multiple HTML pages.

Easy Maintenance:To make a global change simply change the style, and all elements in all the
webpages will be updated automatically.

Search Engines:CSS is considered a clean coding technique, which means search engines won’t have to
struggle to “read” its content.

Superior styles to HTML:CSS has a much wider array of attributes than HTML, so you can give a far
better look to your HTML page in comparison to HTML attributes.

Offline Browsing:CSS can store web applications locally with the help of an offline cache. Using this we
can view offline websites.

CSS Syntax:

CSS comprises style rules that are interpreted by the browser and then applied to the corresponding
elements in your document. A style rule set consists of a selector and declaration block.

Selector:A selector in CSS is used to target and select specific HTML elements to apply styles to.

Declaration:A declaration in CSS is a combination of a property and its corresponding value.

Selector --h1
Declaration --{color:blue;fontsize:12px;}

The selector points to the HTML element you want to style.

The declaration block contains one or more declarations separated by semicolons.

Each declaration includes a CSS property name and a value, separated by a colon.
XML
Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding
documents in a format that is both human-readable and machine-readable. The design goals of XML
focus on simplicity, generality, and usability across the Internet. It is a textual data format with strong
support via Unicode for different human languages. Although the design of XML focuses on documents,
the language is widely used for the representation of arbitrary data structures such as those used in web
services.

XML stands for extensible Markup Language.

XML is a markup language like HTML.

XML is designed to store and transport data.

XML is designed to be self-descriptive.

Basically XML above does not do anything. XML is just information wrapped in tags. Users must require
a piece of software to send, receive, store, or display it.

XML makes web development User Friendly :Many computer systems contain data in incompatible
formats. Exchanging data between incompatible systems or upgraded systems is a time-consuming task
for web developers. Large amounts of data must be converted, and incompatible data is often lost. XML
stores data in plain text format. This provides a software- and hardware-independent way of storing,
transporting, and sharing data.

XML is Extensible:XML applications will work as expected even if data is edited i.e. added or removed.
Example :The above note is edited into a newer version by adding date tag and hour tag , and by
removing the heading tag.

XML can be used to create new internet languages.

A lot of new Internet languages are created with XML.

Here are some examples:

XHTML

WSDLfor describing available web services.

WAPandWMLas markup languages for handheld devices.

RSSlanguages for news feeds.

RDFandOWLfor describing resources and ontology.

SMILfor describing multimedia for the web.


XHTML
XHTML stands forEXtensibleHyperTextMarkupLanguage.It is a cross between HTML and XML language.

XHTML is almost identical to HTML but it is stricter than HTML. XHTML is HTML defined as an XML
application. It is supported by all major browsers.

Although XHTML is almost the same as HTML but It is more important to create your code correctly,
because XHTML is stricter than HTML in syntax and case sensitivity. XHTML documents are well-formed
and parsed using standard XML parsers, unlike HTML, which requires a lenient HTML-specific parser.
Why use XHTML

XHTML was developed to make HTML more extensible and increase interoperability with other data
formats. There are two main reasons behind the creation of XHTML:

It creates a stricter standard for making web pages, reducing incompatibilities between browsers. So it is
compatible for all major browsers.

It creates a standard that can be used on a variety of different devices without changes.

Advantages of XHTML

Here are the following advantages of XHTML, such as:

While using XHTML, the code of web applications becomes more stylish and easy to reuse.

It can help the developer create more advanced web projects due to the compatibility with various devices,
and it also supports self-created markups like SVG (scalable vector graphics).

Disadvantages of XHTML

XHTML also has some disadvantages, such as:

Very few browsers use XHTML.

Case sensitive as every part of code should be in lowercase.

It is mandatory to write < DOCTYPE > declaration.

And all the tags must be closed in the necessary order.


REFERENCES
https://www.geeksforgeeks.org/common-gateway-interface-cgi/
https://www.wikiwand.com/en/XHTML
https://www.w3schools.com/js/

https://www.w3schools.com/html/

https://www.geeksforgeeks.org/XML/

You might also like