Chapter 1
Introduction to object oriented php
1. Which notation is used to access variables of an object?
(a) ::
(b) =
(c) ->
(d) .
2. Which notation should be used to refer to a method in the context of a class rather than an object you use?
(a) ->
(b) \
(c) $
(d) ::
3. Which method is invoked just before an object is garbage collected?
(a) collect()
(b) garbage()
(c) destruct()
(d) _destructor()
4. Which one of the following property scopes is not supported by PHP?
(a) friendly()
(b) final
(c) public
(d) static
5. Which function is used to check if class exists or not?
(a) exist() (c) class_exists()
(b) exist_class() (d) _exist()
6. Which keyword is used to refer to properties or methods within the class itself?
(a) private (c) protected
(b) public (d) $this
7. Objects are also known as
(a) reference
(b) class
(d) template
(c) instance
8. A member function typically accesses members of object only.
(a). current (c) previous
(b) next (d) all of the above
9. The practice of separating the user from the true inner workings of an application through well-known interfaces is known as
(a) Polymorphism (c) Encapsulation
(b) Inheritance (d) Dynamic Message passing
10. PHP recognizes constructor by the name.
(a) classname() (c) function_construct()
(b) _constrct (d) function_construct()
11. Which one of the following can be used to instantiate an object in PHP assuming class name to be Foo?
(a) $obj = new $foo; (c) $obj = new foo ();
(b) obj = new foo; (d) obj = new fool);
12. Which one of the following is the right way to invoke a method?
(a) $object->methodName():
(b) object->methodName();
(c) object->methodName;
(a) $object::methodName;
ANSWERS
1. (c) 2. (d) 3. (c) 4. (a) 5. (c) 6. (d)
7. (c) 8. (a) 9. (c) 10. (d) 11. (c) 12. (a)
Q. I Answer the following questions in short.
1. State the purpose of extends keyword?
2. How to create object in PHP?
3. Which function is used to check if class is exists or not?
4. State the purpose of self keyword? 5. How static method is invoked?
6. What is the use of abstract class?
7. State the purpose of parent keyword?
8. Write characteristics of abstract class.
9. Write characteristics of an interface.
10. What is serialization?
Q. II Answer the following questions.
1. How to call a constructor of a parent class from a child class? Explain withsuitable example.
2. What is Inheritance? Explain with suitable example.
3. Explain the concept of static methods and static property with suitable example.
4. What is an Interface? Illustrate the concept with suitable example.
5. What is abstract class and abstract method? Illustrate with suitable example.
6. What is method overriding? Explain with suitable example.
7. Explain different functions with syntax to examine characteristics of an object
and a class.
8. Write a PHP Script to create a class Worker that has data members as Worker_Name, No_of_Days_worked, Pay_Rate. Define parameterized constructor. Also write necessary member function to calculate and display the salary of worker.
9. Write a PHP program to create a class temperature which contains data members as Celsius and Fahrenheit. Define parameterized constructor to initialize all values of temperature object. Convert Celsius to Fahrenheit and Convert Fahrenheit to Celsius using member functions. Display conversion on next page.
10. Define a class Employee having private members - id, name, department, salary. Define parameterized constructors. Create a subclass called "Manager" with private member bonus. Create 3 objects
of the Manager class and display the details of the manager having the maximum total salary (salary + bonus).
QIII Define the terms
1. Class 2. Object
3. Encapsulation 4. Constructor
5. Destructor 6. Inheritance
7. Serialization 8. Method Overriding
9. Final method 10. Abstract class
Chapter 2
Web Techniues
1. Which of the following PHP variables are used to process form data? (a) $_GET & $_PUT
(b) $_GET& $_POST
(c) $_SET & $_GET
(d) READ & WRITE
2. When $_GET variable is used to collect form data, the data is visible
(a) to nobody (c), to root user
(b) to only one user
(d) to everyone
3. How many predefined variables are used in php to authenticate use?
(a) 3 (b) 4
(c) 2 (d) 1
4. Which of the following PHP variables are use for authentication?
(i) $_SERVER['PHP_AUTH_USER'];
(1) $_SERVER['PHP_AUTH_ROOT];
(i) $_SERVER['PHP_AUTH_PWD'];
(i) $_SERVER['PHP_AUTH_PW'];
(a) (i) and (ii)
(c)(i) and (iv)
(b) (i) and (iii)
(d) (ii) and (iii)
5. Which of the following PHP function is used for authentication?
(a) inspect()
(b) intersect()
(c), header()
(d) footer()
6. Which of the following should not be used while sending crucial information?
(a) $_POST
(b) $_GET
(c) $ PROCESS
(d) $_ISSET
7. Which of the following is not $_SERVER parameter?
(a) SERVER INFO
(b) PHP_SERVER
(c) SERVER NAME
(d) SERVER_PORT
8. Which is true about $PHP_SELF?
(a) It passes php form information to next page.
(b) It stores web page information.
(c) It is used to debug page.
(d) It is used to pass page information to itself.
9. What is correct statement about sticky forms?
(a) It is simply HTML form that remembers data how you filled it.
(b) It is used to submit data to another page.
(c) It is used to pass data to server.
(d) None of above.
10. What is use of $isset() function?
(a) it is used to check whether variable is set or not.
(b) It is used to set variable.
(c) It is used to set new value.
(d) All of above.
ANSWERS
1. (b) 2. (d)
3. (c) 4. (c)
5. (c) 6. (b)
7. (b) 8. (d)
9.(a) 10. (a)
1.What is $_SERVER variable?
2. List different HTML form elements.
3. What is use of isset () method?
4. Why we use $ _REQUEST []?
5. Describe following headers:
(i) Expiration (ii) Redirection (ili) Location (iv) Content-type
Q. II Answer the following questions.
1. Explain different parameters used for $_SERVER information?
2. What is sticky form? Explain.
3. How to set response headers? Justify?
4. How to perform form processing php? Explain.
5. What is self processing form? Explain.
6. Differentiate between $_GET and $_POST variables.
7. Explain what is HITP authentication?
Q. III Define the terms:
1. forms
3. sticky form
5. GET method
2. self processing page
4. html element
6. POST method
Chapter 3
XML
1. XML stands for
(a) Extension modern link (c) extra modern language
(b) extensible markup language (d) x-markup language
2.Which of the following is correct statement?
(a) All XML elements must have closing tag. (b) All XML documents must have DTD.
(c) All XML documents must be in lowercase.(d) XML opening tag should be in uppercase.
3.XML comments are written as
(a) <!-!> (c i <?-?>
(b) <!---? (d) <\$---\%>
4. Which of the following is valid XML tag?
(a) <?xml on ="1.0"?>
(b) <$xml version=1.2">
(c) <xml version on ="1.0">
(d) none of above
5. XML is designed to___ and store data.
(a) design
(b) verify
(c) transport
(d) None of above
6.Well formed XML document means__
(a) It contains a root element.
(b) It contains an element.
(c) It contains one or more elements.
(d) Must contain one or more elements and root elements must contain all other elements.
7.DTD means?
(a) Data Type Definition.
Data Text Decode.
(c) Define Text Data.
None of Above
8. XML DOM object is
Entity
Entity Reference
c) Comment Reference.
Comment Data.
9.XML is case sensitive language.
(a) true
false
(c) Can't Say
d.none
10. Which of the following is XML Parser?
(a) SAX parser
b.DOM Parser
(c) CDATA Parser
d.(a) And (b)
Q. I Answer the following questions in short.
1. List types of XML parser.
2. List any two methods used wit SimpleXML.
3. What is meaning of valid and invalid XML tags?
4. List XML elements.
5. What are different node types in DOM?
6. What is DOMDocument()?
Q. II Answer the following questions.
1. Explain Concept of XML?
2. What is Document Object Model in PHP?
3. How to use XML with PHP explain with example?
4. What is XML parser? What are different types of it?
5. What is SimpleXML extension? 6. Write a PHP code to display XML data through SimpleXML
7. Write a PHP code to generate XML.
8. Write PHP script to create a CD catalog using XML file.
9. Create a XML file which gives details of books available in "ABC Bookstore" from following categories
(1) Technical, (2) Cooking, (3) YOGA
10. Write a PHP script to generate an XML in the following format
<?xml version="1.0" ?>
<BookStore>
<Books>
<PHP>
<title>Programming PHP</title> <publication>0'RELLY</publication>
</PHP>
<PHP>
<title>Beginners PHP</title> <publication>WROX</publication>
</PHP>
</Books>
</BookStore>
11. Create an application that reads "Book.xml" file into simple XML object. Display attributes and elements (Hint: use simple_xml_load_file() function).
12. Write a script to create "cricket.xml" file with multiple elements as shown below:
<CricketTeam>
<Team country="India">
<player> </player> <runs> </runs>
<wicket> </wicket>
</Team>
</Cricket Team>
13. Write a script to create "vehicle.xml" file with multiple elements as given below
<Vehicle>
<Type = Two Wheeler>
<Vehicler Name
</Vehicle Name >
<Company >.. </Company>
<Color>-</Color>
<Average>---</Average>
</Type>
</Vehicle>
Also add Type = "Four Wheeler" and its elements
Q. III Define the terms:
1. DTD.
2. XML Schema
3. element
4.attribute
Chapter 4
Ajax and PHP
1. What are all the technologies used by AJAX?
(a) JavaScript
(c) Document Object Model (DOM)
(b) XMLHttpRequest
(d) Cascading Style Sheets (CSS)
(e) All of the above
2. How can you find out that an AJAX request has been completed?
(b) readyState=3
(a) readyState=4
(c) readyState=1
(d) readyState=2
3. What are all the browsers support AJAX?
(a) Internet Explorer 5.0 and above (b) Opera 7.6 and above
(c) Netscape 7.1 and above
(d) Safari 12 and above
(e) All of the above
4.What is the name of object used for AJAX request?
(b) XMLHttpRequest
(d) xmlhttprequest
(a) XmlHttpRequest (c) XMLHTTPRequest
5.What is the difference between synchronous and asynchronous requests?
(a) Synchronous request blocks the user until a response is retrieved whereas asynchronous doesn't block the user
(b) Asynchronous request blocks the user until a response is retrieved whereas synchronous doesn't block the user
(c) Both are same
(d) None of the above
6. What are the properties of XMLHttpRequest?
(a) onReadyStateChange It is called whenever readystate attribute changes
(b) readyState It represents the state of the request (c) responseText It returns response as text.
(d) responseXML It returns response as XML
(e) All of the above
7 AJAX Stands for
(a) Abstract JSON and XML
(b) Another Java Abstraction for X-Windows
(c) Another Java and XML Library
(d) Asynchronous Javascript and XML
8. The XMLHttpRequest object is used to exchange data with a server
(a) True
(b) False
9. What will be the primary step when you have to send a request using JavaScript to
a server?
(a) You will call the connect() method of the XMLHttp object.
(b) You will call the execute() method of the XMLHttp object.
(c) You will call the open() method of the XMLHttp object
(d) None of above
10 The responseText property returns the response as a string format
(a) True
(b) False
ANSWERS
1. (e)
2 (a)
3. (e)
4 (b)
5. (a)
6. (e)
7 (d)
8 (a)
9. (c)
10 (a)
Q. I Answer the following questions in short.
1. Which are different technologies used in AJAX?
2.Where AJAX cannot be used?
3. What are the advantages of AJAX?
4. How can you find out that an AJAX request has been completed?
5. What is the difference between synchronous and asynchronous requests?
6.What are the security issues with AJAX?
7.Write syntax for creating XMLHttpRequest object.
8. What are different possible value for readyState property?
9.Which methods are used in AJAX to send the request to server?
Q. II Answer the following questions.
1. What are the differences between AJAX and JavaScript?
2. What are the disadvantages of AJAX?
3. How GET and POST methods are used in AJAX? Explain in detail with syntax.
4. How data is sent to server with POST method? Explain with example
5.How to fetch the response received from server? Explain different properties usedfor this?
6.Explain properties of XMLHttpRequest object.
7. Write AJAX program to accept username and password from user. Also validate username and password from database using PHP script. If both are matching in the database then display "Login Successful" otherwise display "Invalid Login details".
8.Write AJAX program to accept book title from user. When user clicks submit button, display book details from XML file if matches otherwise display "No Match Found" using PHP.
9.Write AJAX program to request an XML file from server and print the details of books when user clicks on the Print button.
10. Write AJAX program to fetch suggestions when is user is typing in a textbox. (Hint create array of suggestions and matching string will be displayed).
QIII Define the terms:
1. Synchronous communication
2.Asynchronous communication
3. responseXML
4.responseText
5.XMLHttpRequest Object
Chapter 5
Introduction to Web Services
1 Web services can be discovered using
(a) UDDII
(b) UDDI
(c) UDDDI
(d) UDII
2 What is RPC?
(b) Registered procedure counselor (d) Regional protection control
(a) Regional procedure calls (c) Remote Procedure Calls
3. What is WSDL?
(a) Web Services Detail Language
(b) Web Services Description Language
(c) Web Services Development Language
(d) Web System Description Languag
4 What is NOT a part of a SOAP Message?
(a) SOAP Body
(b) SOAP Header
(c) SOAP Envelope
(d) SOAP footer
5. Which technologies are involved in web services?
(a) SOAP
(b) WSDL
(c) HTTP
(d) XML
(e) All of the above
6.The basic Web Services platform is combination of and
(a) CSS and Java (c) XML and HTML
(b) CSS and HTTP (d) XML and HTTP
7. ________is the basis for Web services.
(a) PHP
(b) CSS
(c) CGI
(d) XML
8.Which of the following is correct about SOAP?
(a) SOAP is an XML-based protocol for exchanging information between computers.
(b) SOAP is a communication protocol
(c) SOAP is for communication between applications.
(d) All of the above.
9. Which of the following component of Web service describes interfaces to web services?
(a) UDDI
(c) SOAP
(b) WSDL
(d) None of the above.
10. What SOAP stands for?
(a) State Access Object Protocol
(c) Simple Access Object Protocol
(d) Simple Allied Object Protocol
(b) State Allied Object Protocol
ANSWERS
1. (b)
2. (c)
3.(b)
4.(d)
5. (e)
6. (d)
8. (d)
9. (a)
10. (c)
Q. I Answer the following questions in short.
1.What is a web service?
2. Explain characteristics of web services
3. List all the technologies of web services.
4. Explain the role of service provider and service requestor.
5. How UDDI works?
6. List benefits of web services.
7. What are challenges with web services?
9. Explain operations or interactions in web service architecture.
8. Why web services are widely used?
10. Explain the importance of XML in web services.
Q. II Answer the following questions.
1. Explain with suitable diagram web services model
2. What are different technologies used in web services
3.Explain WSDL?
4 What are different building blocks of web services? Explain? 5. Discuss steps for implementing web services?
6. What is SOAP? Explain in detail?
7. Explain role of participants in Service-oriented architecture of web services 8. Explain benefits and challenges of web services
9 Explain the structure of SOAP message.
10. Explain the structure of WSDL
Q.III Define the terms:
1 RPC
2. XML
3. UDDI
5. WSDL
4. HTTP
5. SOAP
6. Service provider
7. Service Requestor
8. Service broker/Service registry
Chapter 6
Php Framework(Jomla/Drumpl)
1._____is an application design pattern that separates the application data and business logic from the presentation
(a) CMS ( c)Framework
(b) MVC (d) PHI
2.in Joomla______provides the flexibility to the administrator to select the default template as well as provide editing options for both the main Index file of the template and the style sheet file
(a) Template Manager
(c) Module Manager
(b) Article Manager
(d) Language Manager
3 The_______helps the user to manage and administer a multilingual site
(a) Category Manager
(b) Language Manager
(c) Section Manager
(d) Frontpage Manager
4 The Control Panel is a centralized panel where the administrator can jump to the most
common parts of the site.
(a) Menus
(c) Control Panel
(b) Articles
(d) Modules
5. A template controls the______of a site
(a) settings
(b) layout
(c) various managers
(d) None
6 CSS is
(a) Custom Style Sheet
(b) Cascading Simple Sheet
(d) Category Style Sheet
(c) Cascading Style Sheet
7. Components can also be termed as,
(a) simple applications
(b) mini applications
(c) complex applications
(d) None
8. Articles can also be termed as,
(a) documentation
(b) book
(c) short stories
(d) None
9. For effective and easy navigation. provide links to various web pages.
(a) Menus
(b) Articles
(c) Modules
(d) Templates
10. A sites appearance and presentation can be controlled by. (b) Components
(a) Themes
(c) Menus
(d) Modules
ANSWERS
1. (b)
2. (a)
3. (b)
4. (a)
5. (c)
6 (d)
7.a
8.b
9.a
10. (d)
Q1. Answer the following questions in short
1. What is PHP framework?
2. What is Drupal?
3. What is Joomla?
4. What is the responsibility of Article Manager?
5. List PHP framework names.
6. What does the Language Manager in Joomla do?
7. What is the functionality of Trash Manager in Joomla? 8. How do you test a template in Joomla?
9. How do you add components in Drupal? 10. What does the WYSIWYG Template module do?
11. What are the functionalities provided by Drupal Modules?
12. What is a Content Management System? QII. Answer the following questions.
1 Describe MVC architecture with diagram. 2. List and explain features of Drupal.
3. Explain features of Joomla
4. Explain menus in drupal.
5. What are the features of Administrative toolbar in Drupal? 6. Explain Presentation Administration in Joomla and Drupal.
7. How are articles created in Drupal?
8. How are templates created in Joomla? 9. Explain Content Administration in Joomla and Drupal
10. How are modules and components added in Drupal?
11. Explain System Administration in Joomla and Drupal. QIII. Define the terms
1Framework
2. MVC
3. Content Management System
4. Module
5. Component
6. Plugin
7. Template
8. Article
9. Dashboard
10. Model
11. View
12. Controller
Comments
Post a Comment