1565586552032-PHP Paper 3
1565586552032-PHP Paper 3
6. What does acronym TCP stand for in the standard Internet protocol suit?
A. Transmission Control Protocol
B. Transfer Control Protocol
C. Transfer Control Program
D. None of these
7. Which of the following code segment(s) will correctly add a hidden field to a form?
A. <input type="hidden" name="hidden_name" value="hidden_value" visible="false">
B. <input type="hidden" name="hidden_name" value="hidden_value">
C. <input type="text" name="hidden_name" property="hidden" value="hidden_value">
D. <input type="hiddentext" name="hidden_name" value="hidden_value">
11. What is the correct HTML for referring to an external style sheet?
A. <stylesheet>style.css</stylesheet>
B. <style src="style.css">
C. <link rel="stylesheet" type="text/css" href="style.css">
D. <link rel="cascadingstylesheet" type="css" href="style.css">
12. Which of the following HTML code segments can be used to embed a video in an HTML page?
A. <media src="IJTS.avi" width= "640" height= "480">
B. <object data= "IJTS.avi" type= "video/avi" width= "640" height= "480">
C. <embed src="IJTS.avi" width= "640" height= "480">
D. <media data= "IJTS.avi" type= "video/avi" width= "640" height= "480">
13. Which of the following method sends input to a script via the body?
A. Get
B. Post
C. Both
D. None
14. Which of the following CSS code(s) will add a background image to the body of an HTML document
A. body { bgimage: src="backgroundimage.png" }
B. body { background-image: url("backgroundimage.png"); }
C. body { background-image: src="backgroundimage.png" }
D. body { background: href="backgroundimage.png" }
15. Which of the following attributes is/are available for the IMG tag?
A. src
B. lang
C. width
D. usemap
A. Only ii)
B. None of the mentioned.
C. All of the mentioned.
D. iii) and iv)
A. I am b
B. I am bI am a
C. Error
D. I am a Error
A. helloblabla
B. Error
C. hello
D. helloblablablabla
A. 5 === 5
B. Error
C. 1
D. False
A. Only i)
B. i), ii) and iv)
C. ii), iii) and iv)
D. All of the mentioned.
23. PHP’s numerically indexed array begin with position __.
A. 1
B. 2
C. 0
D. -1
24. The _________ property is mostly used to remove underline from links
A. text-trans
B. text-transformation
C. text-decoration
D. text-deco
25. Which of the following statement(s) is/are true with respect to Cascading Style Sheets?
A. Multiple columns of text can be added to web pages by using CSS.
B. Floating boxes are not allowed in CSS.
C. Images as borders are not allowed in the CSS box-model.
D. CSS box-model allows the creation of rectangular boxes in HTML documents.
SECTION B
1. Briefly explain and write short notes for any five out of seven questions.
A. Cookies in PHP
B. GET and POST
C. cPannel
D. Difference between Static web pages and Dynamic ones.
E. XML DTD.
F. XSLT
G. CSS Inline, External and Internal
B. Show the relationship between the technologies in part A. using a sketch of a client-server
model that shows where each of the above technologies reside and the connections
between them.
4.
A. Suppose you have to make a dynamic website. The login page of the website asks the
username and password as shown below. Consider the following design and write HTML
coding to implement following design. Once a user presses the Login button, the form
action will be submitted to loginaction.php.
Tip for high marks: Use table tag and Ignore sample values in Text boxes.
B. The PHP code of that page validates the user against usernames and passwords in a
database. If that user is a valid user, system creates a session and redirects the user to
home.php. Otherwise, the page displays the message “You are a invalid user”. You can
find the implementation of loginaction.php at the end of this paper, but loginaction.php
consists with mistakes. Note: line numbers only for your reference and those are not a
part of coding.
i. List down the mistakes and correct those mistakes (indicate the line numbers of
code where appropriate). As an example one is done for you.
****
PART A (MCQ) - :
PART B -:
1.
A. Cookies are text files stored on the client computer and they are kept of use tracking purpose. PHP transparently
supports HTTP cookies.
Server script sends a set of cookies to the browser. For example name, age, or identification number etc.
Browser stores this information on local machine for future use.
When next time browser sends any request to web server then it sends those cookies information to the
server and server uses that information to identify the user.
The GET method sends the encoded user information appended to the page request. The page and the encoded
information are separated by the ? character.
http://www.test.com/index.htm?name1=value1&name2=value2
The GET method produces a long string that appears in your server logs, in the browser's Location: box.
The GET method is restricted to send upto 1024 characters only.
Never use GET method if you have password or other sensitive information to be sent to the server.
GET can't be used to send binary data, like images or word documents, to the server.
The data sent by GET method can be accessed using QUERY_STRING environment variable.
The PHP provides $_GET associative array to access all the sent information using GET method.
The POST Method
The POST method transfers information via HTTP headers. The information is encoded as described in case of
GET method and put into a header called QUERY_STRING.
The POST method does not have any restriction on data size to be sent.
The POST method can be used to send ASCII as well as binary data.
The data sent by POST method goes through HTTP header so security depends on HTTP protocol. By
using Secure HTTP you can make sure that your information is secure.
The PHP provides $_POST associative array to access all the sent information using POST method.
C. cPanel is a popular control dashboard that helps you manage your web hosting server using a human-friendly web-
based interface. It’s especially popular with shared hosts, where it’s the de facto solution provided by most
affordable hosting providers. Without cPanel, you would need technical knowledge to manage your
websites/server. But with cPanel, you’re able to make changes using a graphical interface – no technical
knowledge required.
Static Web pages are very simple. It is written in languages such as: HTML, JavaScript, CSS, etc. For static web
pages when a server receives a request for a web page, then server sends the response to the client without doing any
additional process. And these web pages are seen through web browser. In static web pages, Pages will remain same
until someone changes it manually.
Dynamic Web Pages are written in languages such as: CGI, AJAX, ASP, ASP.NET, etc. In dynamic web pages,
Content of pages are different for different visitors. It takes more time to load than static web page. Dynamic web pages
are used where the information are changed frequently, for example: stock prices, weather information etc.
E. The XML Document Type Declaration, commonly known as DTD, is a way to describe XML language precisely.
DTDs check vocabulary and validity of the structure of XML documents against grammatical rules of appropriate
XML language.
F. XSLT, Extensible Stylesheet Language Transformations, provides the ability to transform XML data from one
format to another automatically. An XSLT stylesheet is used to define the transformation rules to be applied on the
target XML document. XSLT stylesheet is written in XML format. XSLT Processor takes the XSLT stylesheet and
applies the transformation rules on the target XML document and then it generates a formatted document in the
form of XML, HTML, or text format. This formatted document is then utilized by XSLT formatter to generate the
actual output which is to be displayed to the end-user.
G. Inline Styles
An inline style may be used to apply a unique style for a single element. To use inline styles, add the style attribute
to the relevant element. The style attribute can contain any CSS property.
With an external style sheet, you can change the look of an entire website by changing just one file. Each page
must include a reference to the external style sheet file inside the <link> element. The <link> element goes inside
the <head> section.
An internal style sheet may be used if one single page has a unique style. Internal styles are defined within the
<style> element, inside the <head> section of an HTML page.
2.
A.
B.
3.
A.
i. Hyper Text Markup Language (HTML) is a markup language for creating a webpage. Webpages are
usually viewed in a web browser. They can include writing, links, pictures, and even sound and video.
HTML is used to mark and describe each of these kinds of content so the web browser can display them
correctly. HTML can also be used to add Meta information to a webpage. Meta information is usually
not shown by web browsers and is data about the web page, e.g., the name of the person who created the
page. Cascading Style Sheets (CSS) is used to style HTML elements while JavaScript is used to
manipulate HTML elements and CSS styles.
ii. Web browsers apply CSS rules to a document to affect how they are displayed. A CSS rule is formed
from:
A set of properties, which have values set to update how the HTML content is displayed.
A selector, which selects the element(s) you want to apply the updated property values to.
A set of CSS rules contained within a stylesheet determines how a webpage should look.
iii. When PHP receives the file it reads through it and executes any PHP code it can find. After it is done
with the file, the PHP interpreter gives the output of the code, if any, back to Apache. When Apache gets
the output back from PHP, it sends that output back to a browser which renders it to the screen.
iv. The heart of the system is the MySQL server. The MySQL server is the manager of the database system.
It handles all your database instructions. In the same manner, to add data to that database, you send a
message to the MySQL server, giving it the data and telling it where you want the data to be added.
B.
4.
A.
B.
i.
ii.