0% found this document useful (0 votes)
58 views22 pages

IT3401 Questionbank

The document is a question bank for a course on Web Essentials, covering topics such as website basics, internet protocols, web design, and client-side scripting. It includes various types of questions, including definitions, comparisons, and coding exercises related to HTML, CSS, and JavaScript. The content is structured into units and parts, providing a comprehensive overview of essential web technologies and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views22 pages

IT3401 Questionbank

The document is a question bank for a course on Web Essentials, covering topics such as website basics, internet protocols, web design, and client-side scripting. It includes various types of questions, including definitions, comparisons, and coding exercises related to HTML, CSS, and JavaScript. The content is structured into units and parts, providing a comprehensive overview of essential web technologies and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 22

lOMoARcPSD|45110858

Question bank for web essential

Scan to open on Studocu


lOMoARcPSD|45110858

DEPARTMENT OF INFORMATION TECHNOLOGY

IT3401-WEB ESSENTIALS QUESTION BANK

UNIT-I WEBSITE BASICS

PART-A

1. List any two types of web servers with its application usage. May-09
There are two types of web servers one is vendor specific and another
one is open source. The example of vendor specific web server is IIS and
example of open source web server
is Apache.
The IIS web server is used on Windows and Apache web server can
be used on both Unix and Windows platform.
2. Why is HTTP called as stateless protocol ? Dec-09

Ans. : The HTTP protocol can not remember the previous


user’s information nor it remembers
the number of times the user has visited the particular web page. That
means it can not
remember the previous states. Hence HTTP is called stateless protocol.
3. What is a web server ? Explain its functionalities. Dec-09
Ans. : Web server is a special type of server to which the web
browser submits the request of
web page which is desired by the client. For example: IIS ,Apache.
Web server processes the request of the user which it submits using the
web browser.
Sometimes the web servers access the database system and fetche
the required information. The
required web page is compiled and sent to the user in his/her
web browser.
4. List some basic internet protocols. May-13
Ans. : Following are some basic Internet

protocols. i. http ii. ftp iii. smtp iv. pop3.


cPSD|45110858

5. For handling the mails which protocol is used ?


Ans. : There are two commonly used protocols for handling the
emails. Simple Mail Transfer
Protocol (SMTP) is a simple protocol which is used to transfer emails
to remote servers. Another
protocol is POP3 i.e. Post Office Protocol Version 3. This protocol
works only at the receivers
end and has no work at the sender’s end.
6. What is the difference between WWW and Internet ?
Ans. : The WWW and Internet are the two different terms. The Internet
is a collection of
computers and other devices such as printers, scanners etc.
connected together whereas WWW is
collection of software and corresponding protocol used to access the
resources over the network.
Thus World Wide Web (WWW) contains huge amount of
documents, images and other
resources which can be accessed using the hyperlinks. People use
Internet through web.

7. What is URL ? Write different parts of


URL. Ans. : The general format of URL is -
Scheme:Address
That is
protocol://username@hostname/path/filename
The scheme specifies the communication protocol. Different schemes
have different forms
of addresses.
Various schemes that are used are http, ftp, gopher, file, mailto, news
and so on.
Example : http://www.vtubooks.com/index.aspx
8. Define URI. May-11
Ans. : The Uniform Resource Identifier (URI) is a string used to
identify the names or resources
on the Internet. The URI is a combination of URL and URN. The
URL stands for Uniform
Resource Locator and URN stands for Uniform Resource Name. The
web address denotes the
URL and specific name of the place or a person or item denotes the
URN. For example
urn:ISBN 978-81-8431-123-2
specifies the address of some book.
0858

Every URI consists of two parts, the part before the colon : denotes
the scheme and the part
after colon depends upon the scheme. The URIs are case insensitive
but generally written in
lower case. If the URI is written in the form of http: then it is both an
URI and URL.
9. What is TCP ?
Ans. : The TCP stands for Transmission Control Protocol. This is
the connection oriented
protocol which help in communicating two machines. Using TCP
the message gets transferred in
an orderly manner.
10. State the uses of Internet protocol. May-12

Ans. : Following are the uses of Internet protocols -


i) The Internet protocol is used to decompose the initial information
flow into packets of
the standard size. At the destination these packets are reassembled back.
ii) The Internet protocol routes the data packets so that transmission
of data is possible to
the machine having desired IP address.
11. List the two forms of URL and its uses. May-14
Ans. : The two forms of URL are Absolute URL and Relative URL.
The absolute URL directly
points to a file whereas the relative URL points to the file or directory
in relation to the present
directory. The URL is a unique address of the file which is accessed
over the internet.
12. Differentiate between internet and intranet. Dec-15
Internet Intranet Internet Intranet
Internet is a network of Internet is a network of computers
computers and it and it
The number of users of The number of users of internet
internet are unlimited. are limited.
Internet contains different Internet contains different sources
sources of information on of limited subjects.
variety of subjects.

Internet contains large Internet can be accessed from the


number of intranets. intranet but with restrictions.
lOMoARcPSD|45110858

It is a collection of various It is mostly any of LAN, WAN or


LANs, WANs and MANs. MAN.

13. List the two forms of URL and its uses. May-14
Ans. : The two forms of URL are Absolute URL and Relative URL.
The absolute URL directly
points to a file whereas the relative URL points to the file or directory
in relation to the present
directory. The URL is a unique address of the file which is accessed
over the internet.
14. State the functions of DNS and protocol used. Dec-12
Ans. : Following are the functions that are carried out by DNS –
1. Accepting and then requesting the programs to convert domain
names to IP addresses.
2. Accepting and then requesting the other DNS servers to
convert domain names to IP
addresses.
15. List any four common browsers. Dec-11

Ans. : The common browsers are Internet Explorer, Mozilla


Firefox, Google Chrome, Safari
16. What is www ?
Ans. : The WWW is a World Wide Web which is a collection of
software and corresponding
protocols used to access the resources over the network. The
WWW contains huge amount of
documents, images, and other resources which can be accessed using
hyperlinks. Thus Internet
can be used through the web.
What is GET and POST request ?
Ans. : The GET method is used to retrieve the information from
a specified URI. The POST
method is used to request the server for desired web page. This is
supposed to be a safe method
of retrieving the information.
17. Give the functionalities of IP protocol.
Ans. : There are two functionalities provided by Internet Protocol
- Decomposition of the initial information flow into packets of
standardized size and
8

reassembling of data at the destination.


The Internet protocol routes the packet through successive
networks, from the source
machine to the destination which can be identified by its IP address.
18. What is the use of cache control in HTTP response header ?
Ans. : Cache is used as a temporary repository. Use of cache improves
the performance. Many
web browsers store web pages viewed by the client in the cache
memory. This brings efficiency
in browsing the web page. The cache control help the user to display
the web page quickly.

PART-B

1. Explain briefly the IIS Web Server. May-10


2. Explain in detail the functions of web server. May-12,
3. Explain the structure of HTTP request and response messages.May-12,
Dec.-12

4. Explain the various Internet protocols used for client


server communication.May-14
5. Explain TCP/IP in detail. Dec-11

PART-C
6. Develop an interactive web page for student registration using HTML
form elements. (15)
7. Explain the most significant HTML elements in detail. (8)
Explain the way in which data can be presented in a tabular form using
HTML. (7)
8. Briefly discuss the HTML frame and table tags. (15)
UNIT-II WEB DESIGNING

PART-A
1. How to write comment statements in HTML ?
Ans. : The comments in HTML can be denoted as follows
- <!- -It is a comment statement -->MoARcPSD|45110858

There should not be a space between angular bracket and exclamation


mark. This comment is
beginning with <!-- and ending with -->. There should not be any
character such as -- inside the
comment.
2. What is the purpose of using frames in HTML?
Ans. : The XHTML frames allows the web designer to present the
web document in multiple
views. Using multiple views one can keep the information visible and
at the same time other
views can be scrolled or replaced. For example, within the same
window, one frame can display
a company information, the second frame can be a navigation menu
and third frame may display
selected document that can be scrolled through or replaced by
navigating in the second frame.
3. How will you create password field in a HTML form ? Dec-11

Ans. : The password field is typically created on the form.


Hence following code can be written
to create it -
<form name=”form1”>
Password:<input
type=”password”/> </form>

4. List and explain any two HTML


elements. Element May -12
Meaning
<title>
This element is used to specify the title of the web page.
This element is defined within the <head> part.
<p>
This element is generally defined in the <body> part. It
is used to create a paragraph.
5. Write HTML code to display an image. Dec.-12
Ans. :
<html>
<head>
<title> Image Demo
</title> </head>
<body>
<img src= "lamp1.jpg" alt= "Light!!" />
858

</body>
</html>

6. List and explain the three flavors of HTML.May -


13 Ans. : The three flavors of HTML are as follows -
1. XHTML 1.0 Strict : When we want a clean markup code or markup
then this type is used.
To get the font, color, layout effects this flavor can be used along with
the CSS.
2. XHTML 1.0 Transitional : By this type we can use the deprecated
or presentational
elements but frames are not allowed.
3. XHTML 1.0 Frameset : We can use this type when we want to use
Frames to partition the
browser window into two or more frames.
7. What are the uses of HTML form ?
Ans. : The HTML forms can be used in variety of applications such as
1. For creating registration forms
2. For creating the login forms
3. For gathering user information
4. For conducting surveys.

8. What is the advantage of using tables on the web document ?


Ans. : Using tables the information can be arranged systematically
in row-wise and column
wise manner.
9. Difference between HTML and HTML5
HTML HTML
The DOCTYPE The DOCTYPE declaration is much
declaration is much longer longer such as <!DOCTYPE html>
such as <!DOCTYPE html
PUBLIC "-//W3C//DTD
XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/
xhtml1/DTD/
xhtml11.dtd">

<audio> and <video> tags <audio> and <video> tags are


are not supported. supported for playing audio and
video
lOMoARcPSD|45110858

files.

Finding out geographic The HTML5 supports the API for


location is impossible identifying the geographic location.
using
HTML

10. What is meant by CSS? Nov/Dec 2008


 CSS stands for Cascading Style Sheets
 Styles define how to display HTML elements
Styles are normally stored in Style Sheets
 Styles were added to HTML 4.0 to solve a problem
External Style Sheets can save you a lot of work
External Style Sheets are stored in CSS files
 Multiple style definitions will cascade into one

11. State the commands in cascading style sheet used for grouping of
elements. NOV/DEC 2007
We can group selectors. Separate each selector with a comma. In the
example below we
have grouped all the header elements. Each header element will be green:
h1,h2,h3,h4,h5,h6
{
color: green
}

12. What is meant by inline CSS?


 An inline style loses many of the advantages of style sheets by mixing
content with
presentation. Such as when a style is to be applied to a single occurrence
of an
element.
To use inline styles we use the style attribute in the relevant tag.
 The style attribute can contain any CSS property. The example shows
how to change
the color and the left margin of a paragraph:
<p style="color: sienna; margin-left: 20px">
This is a paragraph
</p>
13. Give the syntax of CSS rule.Dec.-11, May-12
Ans. : lOMoARcPSD|45110858

<style type="text/css">
h1
14. Define cascading.
Ans. : Cascading is the collection of rules that the browsers use
to determine how to use the
style information.
15. List the limitations of CSS
1. CSS work differently on different browser.
2. One can not read files using CSS
16. Define the hower element.
Ans: The hover is associated with anchor element and the selector for this
element is specified by a:hover.

PART-B
1. State and explain any four HTML elements in detail. Dec-13

2. How are audio files played through HTML? Explain with


an example.Dec-09

3. Explain the purpose and way of creating lists in HTML documents.


Dec-11
4. Explain FRAME and IFRAME tags and attributes.
5. Explain any eight css text propertiesDec-11

PART-C
6. Explain in detail about CSS3. Give the illustration for CSS3 animation.

7. Discuss the various aspects of Normal Flow Box Layout in the context
of CSS.

UNIT-III CLIENT-SIDE PROCESSING AND SCRIPTING


PART-A
1. What is the benefit of using JavaScript code in an
HTML document ? Dec-07

Ans. : Following are some significant benefits of using JavaScript


code in an HTML document
lOMoARcPSD|45110858

1. The client side data validation can be possible using JavaScript.


2. We can access the HTML elements. That means we can have
control over HTML, BODY,
TITLE tags.
3. Since JavaScript is based on the programming constructs we
can control the logic of a
simple scripting language. For example if a mouse pointer is moving
over a text then change
its colour.
4. JavaScript can determine the visitor’s browser and can load the
page accordingly.
2 What is the need for client side scripting ?May-09
Ans. : Following are the issues that get handled using client side scripting
-
1. Simple scripting language like HTML or XML represents the data
on the web page in
simplest manner.
2. The scripting languages like JavaScript and DHTML are useful
for enhancing the
interactivity of the user with the web browser.
3. Mathematical evaluation is also possible using the client side scripting.
4. Using client side scripting languages the web page which gets
designed for the user provides
a graphical user interface using which the user can input his data in
an elegant manner. This
data can then be submitted to database or any server side
scripting language in order to
process it further.
5. The input validation can also be possible using client side
scripting language like JavaScript.
6. Using cascading stylesheets with the client scripts the look and feel
of the web page can be
enhanced.
3. List out the objects used in JavaScript with its purpose.May-09

Ans. : Various objects that can be used in JavaScript are -


1. Math Object - This object provides useful methods that are
required for mathematical
computations.
For example : For computing square root of some number
sqrt(num) method is used.
lOMoARcPSD|45110858

For finding out minimum value of a and b min(a,b) method is used.


2. Number Object - This object is used has various numeric
properties. For example : Largest possible number gets displayed
using MAX_VALUE, for displaying
the pi value PI property is used.
3. Date Object - This object is used for obtaining date and time.
For example using getTime()
function the number of milliseconds can be obtained.
4. Boolean Object - This is the simplest object used to obtain true
or false values.
5. String Object - This object provides many useful string
related functionalities.
For example : For finding out the substring of a given
string substring(begin,end) method
can be used.
4. Explain array creation in JavaScript with example.May-11

Ans. : In JavaScript the array can be created using Array object.


Suppose, we want to create an
array of 10 elements then we can
write, var ar = new Array(10);
Using new operator we can allocate the memory dynamically for
the arrays. In the brackets
the size of an array is mentioned and the var ar denotes the name of
the array. Thus by the above
sentence an array ar will be created in which we can store 10 elements
at the most. Sometimes
the above statement can be written like
this var ar;
ar=new Array(10);

5 State the types of java script statements with examples.


Ans. : Various types of javascript statements are -
1. Simple assignment statements
2. Conditional statements
3. Object manipulation statements
4.Comment statements
5. Exception handling statements

6 Write a Java Script to print “Good Day” using IF-ELSE


condition. May-14
<html>
lOMoARcPSD|45110858

<head>
<script>
function MyMessage()
{
var today=new Date();
var h=today.getHours();
if(h<12)//After 12 O'clock Say Good Bye
//Before 12 O'clock say Good Day
document.write("Good Day");
else
document.write("Good Bye");
}
</script>
</head>
<body onload="MyMessage()">
</body>
</html>

7. Give any three uses of javascript.


Web Development. JavaScript is a scripting language used to
develop web pages
Web Applications
Presentations
Server
Applications Web
Servers Games
Art
Smartwatch Apps.
8. What kind of comments are supported by the
Javascript? Ans:Single line comments start with //.
Multi-line comments start with /* and end with */.
9. What is the use of the word ‘var’ in the javascript?
Ans: The word var is used to define the variables of numeric or string
type.
10. Mention the various java script object models .
• Math Object • String Object • Date Object• Boolean and Number
Object • Document Object • Window Object
11. Define function in java script .
Function is a part of a program or in other words function is a module in
java program which can be called or invoked any number of times from
the main program. Function can be called any number of times but it can
accept any input values or parameters, however it can return only one
lOMoARcPSD|45110858

output at a time.
12. What are the global functions in javascript?
Name of the Purpose
function
decodeURI() Decodes a URI
encodeURI() Encodes a URI
parseInt()
Parses a string and
returns an integer

eval() Evaluates a string and


executes it as if it was script
code
13. State the types of javascript statements with example.(Dec-
13) variable declarations,
assignment statements,
arithmetic statements,
conditional statements,
loop statements, and jump statements.
14. What is the meaning of the widgets?
a widget is an application, or a component of an interface that enables a
user to perform a function or access a service. In this case it was creating
a snippet of code passing in some configuration.
15. What is the use of parseInt() and parseFloat() methods?
parseInt is for converting a non integer number to an int and parseFloat is
for converting a non float (with out a decimal) to a float (with a decimal).
16. What is the use of the toString method with respect to arrays?
The toString( ) method creates a string representation of array . The string
returned by toString( ) is a list of array elements converted to strings and
separated by commas (the same as is returned by the join( ) method when
join( ) is invoked without parameters).
17. What are the properties and methods object window for screen
output?
Property Purpose
Name

Location It contains the URL of the current window.


It is used to get the height of the content area of the
innerHeight
browser window.
lOMoARcPSD|45110858

It is used to get the width of the content area of the


innerWidth
browser window.
Name It contains name of the referenced window.

PART-B
1) State and explain the types of statements in JavaScript.
2) Explain how functions can be written in JavaScript with an example.
3) Explain how local and global functions can be written using JavaScript.
4) Explain the way in which javaScript handles arrays with example.

5) Explain the JavaScript array handling and array


methods. Discuss about javascript debugging. May-12

PART-C
6) Explain the way in which JavaScript handles arrays with example.
(8)
Explain how local and global functions can be written using
JavaScript. (7)
7) Discuss how do you use JavaScript for form validation? Develop a
complete application that would include information functions to
validate the user data. (10)
Write short notes on JavaScript built-in objects. (5)
UNIT-V SERVLETS AND DATABASE CONNECTIVITY
PART-A
1) What are servlets ? Dec-17

Ans. : Servlets are simple Java programs that run on the server.
The servlets are used along
with the http protocol. Hence sometimes they are also referred as
http servlets. Servlets make use
of standard packages such as javax.servlet and javax.servlet.http.
2) What are the uses of servlets ?lOMoARcPSD|45110858

Ans. : Following are the uses of servlets -


Servlets can process and store the data submitted by an HTML form.
Servlets are useful for providing the dynamic contents. For example
retrieving and updating
the databases.
Servlets can be used in the cookies and session tracking. Cookies are
small programs which
can make use of the information submitted on currently accessed
web pages. Similarly session
tracking are the useful programs that keeps track of all previously
accessed the web pages.

3) Explain the difference between get request type and post request type.
May-12, 13

Ans. : In HTTP-GET request the doGet method is used. In HTTP-


POST request the doPost
request is used.
When user submits his request using doGet method then the URL
string displays the request
submitted by the user. But if the doPost method is used then URL
string does not show the submitted contents.
4) Explain cookies. May-08, 10

Ans. : Cookies are some little information that can be left on your
computer by the other
computer when we access an internet. The information is stored in the
cookies using the name
value pair.
5) What is the primary purpose of an HTTP get request ?May-10

Ans. : The HTTP GET request makes use of doGet method. The user can
submit his request
using the doGet request. When user submits his request using
doGet method the URL string is
displayed along with the URL.
6) What is the use of web config file ?
Ans. : The web config file specifies the configuration for the web
application. The URL for the
servlets can be specified using the web config file. It is a XML file usually
located in WEB-INF
folder. RcPSD|45110858

7) What is JDBC ? Dec-17

Ans. : The JDBC stands for Java Database Connectivity. JDBC is nothing
but an
API(Application Programming Interface). It consists of various classes,
interfaces, exceptions
using which Java application can send SQL statements to a database. JDBC
is specially used for
the connectivity of Java with RDBMS packages.
8) What do you mean by result set ?
Ans. : The Result Set is a set of rows from a database, as well as
meta-information about the
query such as the column names, and the types and sizes of each
column. The ResultSet
interface is used to represent the database result set.
9) What is the primary purpose of an HTTP get request ?May-10
Ans. : The HTTP GET request makes use of doGet method. The user can
submit his request
using the doGet request. When user submits his request using
doGet method the URL string is
displayed along with the URL.
10) What are HTTP servlets ?
Ans. : The HTTP servlets are nothing but the servlets only. As servlets are
commonly used
with the HTTP(Hyper Text Transfer Protocol), they are also called
as HTTP servlets.
11) Name the two packages form which most of the servlet classes can
be used.
Ans. : The javax.servlet and javax.servlet.http are the two packages from
which the classes are
used by the servlet.

12) List the two commonly used exceptions used by the servlet.
Ans. : The two commonly used basic exceptions of servlet are
IOException and
ServletException.

13) Write the applications of servlets.


Servlets can support dynamic web page content, provide database access,
serve multiple clients at one time, and filter data. In the application server,
discussions of servlets focus on HTTP servlets, which serve Web-based
clients. You can define servlets as welcome files.
cPSD|45110858

14) Explain the servlet interface and its methods.


Method Description

public void initializes the servlet. It is the life cycle method of


init(ServletConfig servlet and invoked by the web container only once.
config)
public void provides response for the incoming request.
service(ServletRequest It is invoked at each request by the web container.
request,ServletResponse
response)
public void destroy() is invoked only once and indicates that servlet is
being destroyed.
public ServletConfig returns the object of ServletConfig.
getServletConfig()
public String returns information about servlet such as writer,
getServletInfo() copyright, version etc.
15) How is session tracking is achieved by the URL rewriting?
Using URL rewriting for session management. With URL
rewriting, all links that are returned to the browser or that get
redirected have the session ID appended to them. When the user
clicks these links, the rewritten form of the URL is sent to the
server as part of the client request.

16) State the use of ServletContext object.


The object of ServletContext provides an interface between the
container and servlet. The ServletContext object can be used to
get configuration information from the web. xml file. The
ServletContext object can be used to set, get or remove attribute
from the web.

17) What is a servlet containe? Speciy its function.


The servlet container provides the servlet easy access to
properties of the HTTP request, such as its headers and
parameters. When a servlet is called (such as when a servlet is
specified by URL), the Web server passes the HTTP request to
the servlet container. The container, in turn, passes the request to
the servlet. 858

18) What are the two methods used to send a request to a


server? The two most common HTTP methods are: GET and
POST.

19) Explain the servlet API life cycle methods in brief.


the life cycle of an Servlet. init is the first method which will be
invoked when the application starts, this will be followed by service
method being invoked whenever a client requests, and then when the
application stops the destroy method is invoked.

PART-B
1. Explain about architecture of servlet. May-13

2. Describe the servlet architecture and various information invoked


by the servlet container. May-08
3. What is session ? Explain the session tracking systems used. May-
12,14
4. How to create cookies and retrieve its value ?May-09

5. Write a servlet to illustrate the principles of cookies and explain ?


May-13

PART-C
1) Discuss the ways of storing and accessing information using
cookies and handling associated issues. (15)
2) Write a Java Servlet to display net salary of employee, use JDBC
connectivity to get employee details from database. (15)

UNIT-IV SERVER SIDE PROCESSING AND SCRIPTING -


PHP PART-A
1. What is PHP stands for?
PHP stands for "Hypertext Preprocessor." It is a widely-used open-
source
|45110858

scripting language primarily designed for web development.


2. Explain the working of PHP Preprocessor.
Client Requests a Web
Page Server Receives
the Request
PHP Interpreter Processes the
Request HTML Output
Server Sends Response to the Client
Client Receives and Renders the Web Page
3. How do you write the comment
statements? // This is a single-line
comment in PHP
/* This is a multi-line comment in PHP. It can span multiple lines.
*/
4. What are the primitive data types that can be used in
PHP? Integer,Float,String,Boolean,Null,Array,object
5. What are the cookies? Give its uses.
Cookies are small pieces of data that websites store on a user's
device (usually in the web browser) to remember information about
the user or their browsing activity

6. Name any four built in functions in PHP.


String Manipulation: PHP offers numerous built-in functions for
string operations, such as strlen() to get the length of a string,
strpos() to find the position of a substring, substr() to extract a
portion of a string, and str_replace() to replace occurrences of a
substring with another string.
7. List out advantages of PHP. (DEC-17)
Easy to Learn and Use: PHP is a straightforward language with a
simple syntax, making it easy to learn and use.
Open-Source and Free.
Large and Active
Community. Scalability.
Security.
High
Performance.
Platform
Compatibility.
Integration with Other Technologies.

8. How can a PHP program determine the type of the browser that
a web client is using?
<?php
echo
$_SERVER['HTTP_USER_AGENT'];
$browser = get_browser();
print_r($browser);

?>
9. What do you mean by Query String in PHP?

PSD|45110858

A query string is the portion of a URL where data is passed to a


web application and/or back-end database. The reason we need
query strings is that the HTTP protocol is stateless by design
10. What is the use of floor and ceil function in PHP.
The rounding function floor() rounds the number to the nearest
integer below its current value, and ceil() rounds the number to the
nearest integer above its current value.
11. What are cookies? Give its uses.
Cookies are small pieces of text sent to your browser by a website
you visit. They help that website remember information about your
visit, which can both make it easier to visit the site again and make
the site more useful to you.
12. Explain the concept of regular expression in PHP.
regular expressions are strings composed of delimiters, a pattern and
optional modifiers. $exp = "/w3schools/i"; In the example above, /
is the delimiter, w3schools is the pattern that is being searched for,
and i is a modifier that makes the search case-insensitive.
13. Explain the use of prg_match in PHP.
PHP preg_match() function. The preg_match() function is a built-in
function of PHP that performs a regular expression match. This
function searches the string for pattern, and returns true if the
pattern exists otherwise returns false. Generally, the searching starts
from the beginning of $subject string parameter.

14. What do mean by QueryString in PHP?


A query string is the portion of a URL where data is passed to a web
application and/or back-end database. The reason we need query
strings is that the HTTP protocol is stateless by design
15. Differntiate echo() and print() function.
They are both used to output data to the screen. The differences are
small: echo has no return value while print has a return value of 1 so
it can be used in expressions. echo can take multiple parameters
(although such usage is rare) while print can take one argument.
echo is marginally faster than print.”
16. How can a PHP program determine the type of browser that a
web client is using?
One option for determining this information in a PHP script is
the get_browser() function: $browser = get_browser(); By default, this
function will use the $HTTP_USER_AGENT (or
$_SERVER['HTTP_USER_AGENT']) variable.
lOMoARcPSD|45110858

PART-B
1. List and explain various data types in PHP
2. Explain different types of operators used in PHP.
3. Explain the term expression with suitable example.
4. Explain various types of arrays in PHP

PART-C
1) Explain extract,implode,explode and flip function in array
2) Explain how to perform read and write operations in PHP

You might also like