0% found this document useful (0 votes)
10 views5 pages

WT Paper Sem6

The document outlines the differences between GET and POST methods in web development, highlighting security and data size considerations. It also discusses XML as a meta markup language, its applications, and the relationship between PHP and XML, including the use of XML parsers. Additionally, it covers JavaScript, its features, jQuery, variable scope, AJAX, and the CodeIgniter framework for building dynamic web applications.

Uploaded by

armanmohd50584
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

WT Paper Sem6

The document outlines the differences between GET and POST methods in web development, highlighting security and data size considerations. It also discusses XML as a meta markup language, its applications, and the relationship between PHP and XML, including the use of XML parsers. Additionally, it covers JavaScript, its features, jQuery, variable scope, AJAX, and the CodeIgniter framework for building dynamic web applications.

Uploaded by

armanmohd50584
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GET and POST:- 1) Get Method sends the encoded user Characteristics of XML :-XML is a self descriptive language .

It
information appended to the page request( to the URL). 1) means we can create our own tags in our application . 2)XML is
POST Method transfers the information via HTTP headers not a public standard. As XML was developed by organization called
through the URL. 2) Get request is not secured because data is W3C and is available as an open standard. 3)XML carries data ,
exposed in URL bar. 2) Post request is secured because data is does not present it. XML allows you to store the data
not exposed in URL bar. 3) GET Method is restricted to send up irrespective of howit will be presented.
to 1024 characters 3) The POST method does not have any Applications of xml:-1) Cell phones: XML data is same to some
restriction on data size to be sent. 4) Get request is idempotent cell phones & display it according to the particular format
. It means second request will be ignored until response of first specified by cell phones software design. 2) File converters:
request is delivered 4) Post request is non idempotent. 5) Get Applications such as pdf to XML converter and voice XML that
request can be bookmarked. 5) cannot converts XML data into voice is used. 3)Data transfer : You can
Processing Forms :- Forms are the essential part of web use XML to transfer data between two systems that store the
development • They are used to communicate between the same data in different formats. 4) Data type : Many
user and the server. • Form is a way to get the information of programming languages support XML as a data type. With this
the user and give it to the server ,let the server do processing in support, you can easily write programs in other languages that
the response to users input. • There are two methods that work directly with XML files
client can use to pass the data to server i.e get and post Xml parser:- A parser is a piece of program that takes a physical
Session:- A session can be defined as a series of related representation of data & converts it into in memory format. 2)
interaction between the single client and web server which An xml parser is used to create, read & manipulate an XML
takes place over a period of time. • In short it is browsing time document. 3) XML parser used to access XML document in PHP.
of the user session allows you to store data in web server 4)In php there are two types of XML parser.
associated with session_id. • Session provides a way to 1.Tree based parser:-This parser transforms the XML document
preserve certain data across subsequent access this enables us into tree structure and then we can access tree element
to build more customized application. individually. There are 2 types of tree-based parser: a. Simple
cookie • A cookie is a small piece of data in the form of name XML parser b.DOM[Document Object Model] 2) Event based
and value pair i.e send by web server and stored by browser on parser:-This parser views XML document as a series of events.
client machine • A server can send one or more cookies to When specific event occur, it calls a function to handle it. NOTE:
browser in a header of response. • Cookie is created at server Event based parser do not hold the entire document in
side and saved to client side. • Each time when client send memory. Instead, they read one node at a time & allow you to
request to server cookie is created. • The function setcookie() is interact with real time. This parser is focused on content of
used to send cookie to browser • Syntax: XML not their structure. EX 1.XML Reader Parser 2.XML Expact
setcookie(name,value,[expired,[path,[domain[secure]]]]); Parser
1) session_start():it is used to start new session or return DOM [document object model parser]  An xml parser only
existing session if it is already created. Syntax: boolean read only XML document. It cannot alter documents or create
session_start(); documents so an alternative approach is methods, DOM
What is XML:  XML is not a markup language. It is meta extension.  DOM is a way of expressing various nodes
markup language that specifies rules for creating markup [elements attributes] of an XML document as a tree of objects.
languages.  XML is a text based markup language derived Then the tree can be traverse &various node can access it.  By
from Standard Generalized Markup Language (SGML).  XML using various DOM Class methods,we can also change node
stores the data in a structured format by using meaningful tags. contents.
 XML is a Subset of SGML. XML Syntax Rules:-1) There is only one parent element
containing all the rest of the elements. 2) XML elements are
declared to be either non - empty, in which case they are
designed to contain data; or empty, in which case they cannot
contain data.3) XML elements must have a closing tag. For example:
<p>This is …</p> 4) XML elements can have attributes in name/value
pairs like HTML. In XML the attribute values must always be quoted.
Relationship between php & xml:-1)XML & PHP can be Javascript is a scripting language design primarily for adding
combined to build web applications.2)PHP & XML work interactivity to the web page and creating web application.2)
together in multiple ways-parsing,generating, configurations. & Script means list of actions for something to perform. 3) A
data examples exchange 3)PHP provides build in extensions like scripting language is a language that interprets runtime. 4)
simpleXML, DomDocument & XMLReader to read & parse xmL Examples of scripting language: There are two types of
Data 4)PHP can dynamically generate xml filed for API's. scripting language 1. Client side scripting 2. Server side scripting
Simple XML extension:- --||-- is an extention of php. This 1)Client side script runs at users end. That is Browser executes
extension has a set of function that are used to handle the xml the scripts. Eg. HTML, CSS, and JavaScript. 2) Server side script
and convert them into an object . After the conversion to an is executed on web server. Eg. PHP, ColdFusion, Python,
object it is easy to process the xml as we do with other ASP.net, Java, C++.
conversional objects. Functions:-1)simplexml_load_file:- it Advantages of JavaScript 1. Speed: Since JavaScript is an
parses an xml file into a simple xml object. 2) simplexml_load_ ‘interpreted’ language, it reduces the time required by other
string:- parse an xml string into simplexml object. 3) simplexml programming languages like Java compilation. 2. Simplicity:- for
Element→xpath:- it returns an array of simplexmlElement JavaScript is easy to understand and learn. 3. Popularity:- Since
object. 4) simplexmlElement→asxml:-converts simplexml all modern browsers support JavaScript, it is seen almost
object back to xml string. everywhere 4. Interoperability:- JavaScript works perfect with
Features of JavaScript:- 1) JavaScript is an object-based other programming languages and therefore numerous
scripting language. 2. It is light weighted. 3. JavaScript is a developers prefer it in developing many applications
scripting language and it is not java. 4. JavaScript is interpreter Disadvantages of JavaScript 1. Client-side Security − The user
based scripting language. 5. JavaScript gives HTML designers a can see the JavaScript code, it could be misused by others. 2.
programming tool. Java script can not e used for networking application. 3.
jQuery:- is a JavaScript library. jQuery is light weight, open- Browser Support − Depending on the browser, JavaScript is
source java script library that help us to build interactive web interpreted differently. 3. Lack of Debugging Facility:- Though
pages with animation, visual effects and advanced some HTML editors support debugging, it is not as efficient as
functionality.  It is cross-platform and supports different types other editors like C/C++ editors.
of browsers. It is also referred as write less do more? because it Data Types in JavaScript:-1) String: - The string data type is used
takes a lot of common tasks that requires many lines of to represent textual data. Strings are created using single or
JavaScript code to accomplish, and binds them into methods double quotes. Ex:- var a = 'Hello!'; // using single quotes var b
that can be called with a single line of code whenever needed. = "Hello!"; // using double quotes 2) Number:  The number
jQuery was first released in January 2006 by John Resig. data type is used to represent positive or negative numbers
Syntax:- $(selector).action() with or without decimal place, or numbers written using
jQuery Selectors:- are used to select HTML element(s) from an exponential notation.  Example: var a = 25; // integer 3)
HTML document. Consider an HTML document is given and you Boolean: The Boolean data type can hold only two values: true
need to select all the <div> from this document. This is where or false. It is typically used to store values like yes (true) or no
jQuery Selectors will help. The jQuery selectors can be used (false), on (true) or off(false) var a = 2, b = 5, c = 10; alert(b > a)
single or with the combination of other selectors. They are // Output: true 4) NULL: A null value means that there is no
required at every steps while using jQuery. They are used to value. It is not equivalent to an empty string ("") or 0, it is
select the exact element that you want from your HTML simply nothing. Example: var a = null; alert(a); // Output: null
document. All selectors in jQuery start with the dollar sign Advantages of jQuery:1) Simple and Easy: JavaScript have
and parentheses: $(). 2)Selectors:-1) Tag Name: It represents a predefined methods using we can perform any task easily
tag name available in the DOM. For example: $('p') selects all compare to JavaScript. 2) Cross browser support: jQuery
paragraphs'p'in the document. 2) Tag ID: It represents a tag support all modern web-browser. 3. Lightweight: jQuery is very
available with a specific ID in the DOM. For example: $(‘#t1') lightweight library. Disadvantages of jQuery: 1. jQuery Not built
selects a specific element in the document that has an ID of t1. for larger and complex applications. 2. For larger and more
3) Tag Class: It represents a tag available with a specific class in complicated applications we will need to extend way beyond core
with additional libraries and Plugins. 3. jQuery is easy to install and
the DOM. For example: $(‘.abc') selects all elements in the
learn, initially. But it’s not that easy if we compare it with CSS.
document that have a class of abc.
Variable Scope: -The scope of a variable is the region of our JS POP-UP BOXES:- When we want something highlighted,
program in which it is defined. • JavaScript variable will have prompted or any important thing to say to users, so we can use
only two scopes: 1. Global variables: A global variable has Popup Boxes. Types:-1) Alert Box:- An alert box is often used if
global scope which means it is defined everywhere in our we want to make sure information comes through to the user.
JavaScript code. 2. Local variables: A local variable will be When an alert box pops up, the user will have to click "OK" to
visible only within a function where it is defined. Function proceed. Syntax:- alert("Message") 2) Confirm Box:- A confirm
parameters are always local to that function. Syntax:- : var box is often used if you want the user to verify or accept
variable_name = value; something. When a confirm box pops up, the user will have to
JavaScript Data Types:-1) String Represents sequence of click either "OK" or "Cancel" to proceed. Syntax:- confirm
characters e.g. "hello". 2) Number Represents numeric values ("Message") 3) Prompt Box:- A prompt box is often used if you
e.g. 100. 3) Boolean Represents boolean value either false or want the user to input a value before entering a page. • When
true. 4) Null Represents null i.e. no value at all. 5) Undefineda prompt box pops up, the user will have to click either "OK" or
Represents undefined value. "Cancel" to proceed after entering an input value. Syntax:-
AJAX:-stands for Asynchronous JavaScript and XML. • AJAX is a prompt("sometext","defaultvalue")
set of web development techniques that uses various web Advantages of Ajax: 1. Better interactivity: Ajax allows easier
technologies on client side to create asynchronous web and quicker interaction between user and website as whole
applications. • With Ajax Web Applications can send and pages are not reloaded for content to be displayed. 2) Easier
retrive the data from server asynchronously without interfering navigation: Ajax applications on websites can be built to allow
with display and behavior of existing page • Examples of easier navigation to users in comparison to using the traditional
applications using AJAX: • Google Maps, Gmail, YouTube, and back and forward button on a browser. 3) It loads page on
Facebook, Google Suggestions. Asynchronous JavaScript & xml demand. 4)Service based approach to web development.
5)Reduced page Bandwidth. Disadvantages: AJAX is dependent
is a new technique for creating better, faster & more interactive
on Javascript, if there is some Javascript problem with browser
web application with help of xml, html, css & JavaScript. Ajax is
not a technology but group of interrelated technologies. or in operating. System then AJAX will not support.2)Debugging
Key Features of Ajax  AsynchronousDataExchange: AJAX is difficult. 3)All browsers do not support JavaScript or
allows web pages to be updated asynchronously by exchanging XMLHttpRequest object. 4) Increase size of request.
small amounts of data with server behind the scene.  Dynamic Ajax web application:- 1) Synchronous (Classic Web Application
Content Update: Only specific part of the web page can be Model): • The nature of interaction between the client and the
updated based on user's action. This is particularly useful for server is of start-stop-start-stop • The browser response to the
chat interface or live notification.  Improved Performance: By user action by discarding the current HTML page. The request is
reducing the server load and unnecessary data transfer ,Ajax sent to the web server. • When the server completes the
speed up web application. processing of request, it returns the response page to the Web
browser. • Browser refreshes the screen and displays the new
XMLHttpRequest Object  This Object is Key to Ajax.  This
HTML page. This is called as synchronous request response
Object is Used for Asynchronous Communication Between
model.
Client & Server.  This object sends HTTP request and receive 2) Asynchronous (Ajax Web-Application Model): • The
response.  The XMLHttp Object can be used in calling the web intermediary layer is introduced between the user and the Web
page either in synchronous or asynchronous mode.  It server. • The Web page sends its requests using JavaScript. The
Updates the Webpage Without Reloading the entire page. request is done asynchronously, meaning that code execution
Syntax to create XMLHttp Request. Xmlhttp=new does not wait for response. • The server response comprises of
XMLHttpRequest(); data and not the presentation. The Ajax engine can understand
and interpret the data. • Most of the page does not change,
only parts of the page that need to change are updated.
CodeIgniter is an open-source software rapid development web PAGE REDIRECTING • While building Web application,
framework, for use in building dynamic web sites with PHP. sometimes we need to redirect a Web page to another Web
CodeIgniter is a PHP MVC framework used for developing Web page. • CodeIgniter uses the redirect() function for page
applications. • CodeIgniter provides out of the box libraries for redirection. Syntax:- redirect($uri = '', $method = 'auto', $code
connecting to the database and performing various operations = NULL). Parameters:- • $uri (string) is the URI string. •
like sending emails, uploading files, managing sessions, etc. • $method (string) redirect method (‘auto’, ‘location’ or
CodeIgniter is a powerful PHP framework with a very small ‘refresh’). • $code (string) is the HTTP Response code (usually
footprint, built for developers who need a simple and elegant 302 or 303). Return Type:- void
toolkit to create full-featured web applications.
Features of CodeIgniter: 1. MVC Architecture: The PHP
CodeIgniter framework uses the Model-View Controller (MVC)
architectural design. The MVC architecture is an industry
standard practice when working with web applications 2)
Extendable: CodeIgniter comes with some libraries and helpers
out of the box 3) Loosely Coupled: The built-in features of
CodeIgniter are designed to work independently without
relying too much on other components which makes it easy to
maintain and make upgrades 4. Small Footprint: The entire
source code for CodeIgniter framework is close to 2MB. This
makes it easy to master CodeIgniter and how it works.
MVC FRAMEWORK • CodeIgniter is based on the Model-View-
Controller (MVC) development architecture. MVC standards for
Model-View-Controller. • MVC is a software design pattern
which separates application logic from its presentation which
dictates the clear separation of concerns. • CodeIgniter uses
the Model, View, Controller (MVC) pattern to organize the files.
1) Model: The MVC model represents application's data
structures. Model classes interface with database and contain
functionality for retrieving, inserting and updating information
in the database. 2. View: It is responsible for data presentation.
A view contains information presented to an end user and on
most occasions is normally a Web page. 3. Controller: It is an
interface between a model and a view. In MVC all user requests
are handled by a controller. It coordinates the activities
between the model and the view.
Workflow in MVC Architecture :- 1. Browser sends HTTP
request to a controller. 2. The controller retrieves the request
parameters and instantiates the model, sets the model
parameters and optionally invokes one or more model
functionalities. The result of this is the generation of a data
array. 3. The data arrays resulting from interaction of controller
with the model are passed on the view. 4. The view employs
this data for generating presentation. 5. Finally, the
presentation generated by a view is sent to the browser as a
response.

You might also like