Professional Documents
Culture Documents
Namma Kalvi 12th Computer Applications Chapter 4 Surya Guide em
Namma Kalvi 12th Computer Applications Chapter 4 Surya Guide em
Namma Kalvi
< ?php
www.nammakalvi.org $num = 1;
$num1 = 2;
PART II
print $num . “+”. $num1 ;
?>
Choose the Correct Answers
a) 3 b) 1+2
c) 1.+.2 d) Error
1. What does PHP stand for?
a) Personal Home Page 8. Which of the following PHP statements will
b) Hypertext Preprocessor output Hello World on the screen?
c) Pretext Hypertext Processor a) echo (“Hello World”); b) print (“Hello World”);
d) Pre-processor Home Page c) printf (“Hello World”); d) sprintf (“Hello World”);
2. What does PHP files have a default file 9. Which statement will output $x on the
extension? screen?
a) .html b) .xml a) echo “\$x”; b) echo “$$x”;
c) .php d) .ph c) echo “/$x”; d) echo “$x;
3. A PHP script should start with ___and end 10. Which of the below symbols is a newline
with ___: character?
a) <php> b) < ? php ?> a) \r b) \n
c) < ? ? > d) < ?php ? > c) /n d) /r
SURYA 1
Chapter - 4 Introduction to PHP www.nammakalvi.org XII Std - Computer Application
2. What is Web server? Example:
A Web server is Software that uses HTTP If you defined variable in lowercase, then you
(Hypertext Transfer Protocol) to serve the files need to use it in lowercase everywhere in
that form Web pages to users program.
Web server software that runs on server
8. How to declare variables in PHP?
hardware, governs the server side scripting
Variable name must always begin with a $
compilation into an intermediate byte-code that
symbol.
is then interpreted by the runtime engine.
Variable name can never start with a number.
3. What are the types scripting language? Variable names are case-sensitive.
Web scripting languages are classified into two
9. Define Client Server Architecture.
types,
Client-server architecture is a network architec-
Client side scripting language
ture in which each computer or process on the
Server side scripting language
network is either a client or a server.
4. Difference between Client and Server? Servers are powerful computers or processes
Client Server dedicated to managing disk drives printers, or
The client-side The server-side network traffic
environment used to environment that runs a Clients are PCs or workstations on which users
run scripts is usually a scripting language is a run applications.
browser. web server. 10. Define Web server.
Does not need server Requires server A Web server is Software that uses HTTP (Hyper-
Interaction interaction. text Transfer Protocol) to serve the files that form
Example: HTML, CSS, Example PHP, ASP.net, Web pages to users.
JavaScript etc. Ruby on Rails, Python,
etc.
PART IIII
5. Give few examples of Web Browser?
Google Chrome Explain in Brief Answer
Mozilla Firefox
Opera 1. Write the features of server side scripting
Safari language.
Internet Explorer Server-side scripting offers greater protection for
UC Browser user privacy
Netscape Navigator etc. It often reduces the loading time for web pages
Some browsers don’t fully support JavaScript, so
6. What is URL?
server-side scripting is essential to run dynamic
URL is the abbreviation of Uniform Resource
pages on these browsers.
Locator
It is the address of a specific Web page or file on 2. Write is the purpose of Web servers?
the Internet. A web server (or Web server) is server software,
URL is made up four parts–protocols, hostname, or hardware dedicated to running said software,
folder name and file name. that can satisfy World Wide Web client requests.
Example: http://www.google.com/ A web server can, in general, contain one or
more websites.
7. Is PHP a case sensitive language?
A web server processes incoming network
Yes, PHP is a case sensitive language
requests over HTTP and several other related
protocols.
2 SURYA
XII Std - Computer Application Chapter - 4 Introduction to PHP
3. Differentiate Server side and Client Side Scripting language.
Basis for
Server-side scripting Client-side scripting
comparison
Works in the back end which could not be visible at Works at the front end and script are
Basic
the client end. visible among the users.
Does not need interaction with the
Processing Requires server interaction.
server.
L a n g u a g e s PHP, ASP.net, Ruby on Rails, ColdFusion, Python, et-
HTML, CSS, JavaScript, etc.
involved cetera.
Could effectively customize the web pages and provide
Affect Can reduce the load to the server.
dynamic websites.
Security Relatively secure. Insecure
4. In how many ways you can embed PHP The processing takes place on the end users
code in an HTML page? computer.
There are two ways to use HTML on your PHP The source code is transferred from the web
page. server to the user’s computer over the internet
The first way is to put the HTML outside of your and run directly in the browser.
PHP tags. You can even put it in the middle if you The scripting language needs to be enabled
close and reopen the tags. on the client computer. Sometimes if a user is
The second way to use HTML with PHP is by conscious of security risks they may switch the
using PRINT or ECHO. By using this method you scripting facility off.
can include the HTML inside of the PHP tags. When this is the case a message usually pops up
to alert the user when script is attempting to run.
5. Write short notes on PHP operator.
Operator is a symbol which is used to perform
Server-side Environment
mathematical and logical operations in the
A server is a computer system that serves as a
programming languages.
central repository of data and programs and is
Different types of operator in PHP are:
shared by clients
•• Arithmetic operators
The server-side environment that runs a scripting
•• Assignment operators
language is a web server.
•• Comparison operators
A user’s request is fulfilled by running a script
•• Increment/Decrement operators
directly on the web server to generate dynamic
•• Logical operators and
HTML pages.
•• String operators
This HTML is then sent to the client browser.
It is usually used to provide interactive web sites
PART IVI
that interface to databases or other data stores
on the server.
Explain in detail
This is different from client-side scripting where
1. Explain client side and server side scripting scripts are run by the viewing web browser,
language. usually in JavaScript.
Web scripting languages are classified into two The primary advantage to server-side scripting
types, client side and server side scripting language. is the ability to highly customize the response
based on the user’s requirements, access rights,
Client-side Environment or queries into data stores.
The client-side environment used to run scripts is
usually a browser.
SURYA 3
Chapter - 4 Introduction to PHP www.nammakalvi.org XII Std - Computer Application
2. Discuss in detail about Website develop- Step 2:
ment activities. •• After downloading. MSI file from Apache
Web development concept describes in detail foundation Website, user launches the. MSI
about Website development and hosting through file and clicks next and next button to finish
network (Internet/Intranet). the installation on server machine.
The process of development also includes •• The software takes default port number 130
•• Web content generation or 130130.
•• Web page designing •• Once the user finished, the Web server
•• Website security and so on. software is installed and configured on server
hardware machine as a service.
Website Development Life Cycle
1. Information Gathering Step 3:
•• Set goals for the website •• To test the installation of Apache Httpd
•• Define website’s target audience Webserver, enter the following URL from your
2. Planning Web browser which is installed in your client
•• Create a sitemap sketch machine.
•• Create a wireframe/mockup https://localhost:130/ or https://
•• Select technology stack localhost:130130
3. Design •• The output page that says “Its works”
•• Create colorful page layouts Step 4:
•• Review the layouts •• Administrator user can start, stop and restart
•• Get client’s feedback on the layouts the Web server service at any time via
•• Change the layout when required windows Control panel.
4. Content writing and assembly •• Once the services stops, the client machine
•• Create new content will not receive the response message from
•• Get content ready for migration server machine.
5. Coding Step 5:
•• Build and deploy website •• Webserver’s configuration setting file “httpd.
•• Add special features and website conf ” is located in the conf directory under
•• Testing, Review and Launch the apache installation directory.
6. Test the create website •• Edit this file and enable the PHP module to
•• Upload the website to server run PHP scripting language.
•• Final test and launch
4. Discuss in detail about PHP data types.
7. Maintenance and Regular updating
PHP scripting language supports 13 primitive
•• Add report system
data types.
•• Fix bugs
Data Types plays important role in all program-
•• Keep website up-to-day
ming languages to classify the data according to
3. Explain the process of Webserver the logics.
installation. PHP supports the following data types.
The following are the steps to install and config- •• String
ure Apache Httpd Web server and PHP module in •• Integer
windows server machine. •• Float
•• Boolean
Step 1: •• Array
•• Go to Apache foundation Website and •• Object
download the Httpd Web server Software. •• NULL
https://httpd.apache.org/download.cgi •• Resource
4 SURYA
XII Std - Computer Application Chapter - 4 Introduction to PHP
Arithmetic operators
The arithmetic operators in PHP perform general arithmetical operations, such as addition, subtraction,
multiplication and division etc
Assignment Operators:
Assignment operators are performed with numeric values to store a value to a variable.
The default assignment operator is “=”. This operator sets the left side operant value of expression to right
side variable.
SURYA 5
Chapter - 4 Introduction to PHP www.nammakalvi.org XII Std - Computer Application
Comparison Operators:
Comparison operators perform an action to compare two values.
These values may contain integer or string data types (Number or Strings).
Logical Operators:
Logical Operators are used to combine conditional statements.
String Operators:
Two operators are used to perform string related operations such as Concatenation and Concatenation
assignment (Appends).
Operator Name Example Result
. Concatenation $text1 . $ text2 Concatenation of $txt1 and $txt2
.= Concatenation $text1 .= $ text2 Appends $txt2 to $txt1
6 SURYA
XII Std - Computer Application Chapter - 4 Introduction to PHP
11. Which of the following is an assignment
ADDITIONAL QUESTIONS AND ANSWERS: operator?
a) = b) = = c) = = = d) ! = =
PART AI
12. Which of the following is an identical
Choose the correct answers: operator?
a) = b) = = c) = = = d) ! = =
1. The variable in PHP begins with a dollar 13. Which of the following is an non-identical
______symbol operator?
a) @ b) # c)$ d) %
a) = b) = = c) = = = d) ! = =
2. The assignment activity implemented 14. Which of the following is an equal operator?
using ___ operator, a) = b) = = c) = = = d) ! = =
a) + b) - c) * d) =
15. PHP, ____is released by theofficial team on
3. In PHP, Variable name can never start with 30 November 2017.
a_____. a) 7.1 b) 7.2
a) alphabet b) number
c) 7.3 d) All of the above
c) both a and b d) either a or b
16. ______is a collection of characters within
4. PHP scripting language supports _____ the double or single quotes
primitive data types. a) String b) Boolean
a) 10 b)1 1 c) 12 d) 13
c) Integer d) Float
5. PHP was invented by _______ 17. Boolean is a data type which denotes___
a) RasmusLerdorf b) Dennis Ritchie
a) Integer numbers b) Decimal point numbers
c) Bjarne Strousrup d) James Goasling
c) True or False state d) Array
6. PHP was invented in _____ 18. ____ is a data type which has multiple
a) 1992 b) 1993
values in single variable.
c) 1994 d) 1995
a) Integer numbers
7. PHP can embed with _____ b) Decimal point numbers
a) HTML b) CSS c) True or False state
c) Javascript d) All of the above d) Array
8. Which of the following isthe important 19. We can use ___ to comment multiple lines?
server side Web and general purpose a) /? b) // c) # d) /* */
scripting language? 20. ____is a data type which contains
a) HTML b) CSS
information about data and function inside
c) Javascript d) PHP
the class.
9. PHP also creates ______ Webpages in a) Integer numbers b) Array
thereal time Web development projects. c) True or False state d) Array
a) Dynamic b) interactive
c) both a and b d) None of these ANSWERS FOR OBJECTIVES
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
10. 78.9 % of Website are developed by_____
c d b d a c d d c d
scripting language.
a) ASP b) JSP 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.
c) VbScript d) PHP a c d b c a c d d d
SURYA 7
Chapter - 4 Introduction to PHP www.nammakalvi.org XII Std - Computer Application
Abbreviations: PART CI
ASP - Active Server Page Explain in Brief Answer
JSP - Java Server page.
CSS - CascadingStyle Sheets
1. Write the Characteristics of PHP.
PHP - Hypertext Pre-processor
WWW - World Wide Web Open Source
CGI - Common GatewayInterface Case Sensitive
OOPs - Object Oriented Programming Simplicity Program language
Efficiency Program language
PART BI Platform Independent Program language
Security Program language
Short Answers
Flexibility Program language
4. What is the main advantage of PHP variable These variables hold specific handlers tohandle
declaration? files and database connections irrespective PHP
The main advantage of the PHPvariable program.
declaration is, it does not requires tospecify the
data type keyword separately such as int, char,
float, double or string etc.
8 SURYA
XII Std - Computer Application Chapter - 4 Introduction to PHP
PART DI
Explain in detail
Default Syntax:
The default Syntax begins with “<?php”and c loses with “?>”.
www.nammakalvi.org
SURYA 9