SlideShare a Scribd company logo
1 of 6
Download to read offline
Aafreen Shaikh(CSJC,Jalgaon)
Chapter 5 Server-Side Scripting (PHP) Textbook
Solutions
Fill in the blanks.
(1) PHP is __________ side scripting language.
Answer : Server
(2) PHP is _________ language i.e. there is no need for compilation.
Answer : interpreted
(3) A variable starts with __________ sign followed by variable name.
Answer : $
(4) An _________ is a variable, which can hold more than one value at a time.
Answer : array
(5) Information can be passed to functions through ___________.
Answer : arguments
State True/False
(1) PHP is platform dependent scripting language.
• True
• False
Answer : False
(2) $_POST is an array of variables passed via the URL parameters.
• True
• False
Answer : False
(3) A Function is a block of statements that can be used repeatedly in a program.
• True
• False
Aafreen Shaikh(CSJC,Jalgaon)
Answer : True
(4) PHP cannot be embedded along with HTML tags.
• True
• False
Answer : False
(5) GET should NEVER be used for sending sensitive information.
• True
• False
Answer : True
Multiple Choice Question (1 correct)
(1) The program file of PHP havev _________ extension.
• .asp
• .php
• .js
• .txt
Answer : .php
(2) A variable declared ___________ a function has global scope.
• outside
• anywhere
• inside
• none
Answer : outside
(3) The ____________ function returns a part of a string.
• trim()
• ucwords()
• substr()
• strpos()
Answer : substr()
Multiple Choice Question. (2 correct)
(1) The _________ and _________ are valid data types in PHP.
Aafreen Shaikh(CSJC,Jalgaon)
a) Double
b) Varchar
c) Integer
d) Array
e) Biglnt
Answer : Integer and Array
(2) Single line comment in PHP is possible using _______, __________.
a) //
b) /* */
c) #
d) <!-- -->
e) $
Answer : // and /* */.
Multiple Choice Question. (3 correct)
(1) ln PHP, three types of arrays are ________, _________, __________.
a) Indexed
b) Simple
c) Associative
d) Multidimensional
e) Complex
f) General
Answer : Indexed, Associative, Multidimensional.
(2) The scope of variable can be _______, _______, ______.
a) local
b) global
Aafreen Shaikh(CSJC,Jalgaon)
c) universal
d) static
e) final
f) outside
Answer : local, global, static.
Brief Questions.
(1) Explain any two features of PHP?
Answer :
PHP is the most popular and frequently used worldwide server-side scripting
language.
Following are features of PHP:
1. Simple: It is very simple and easy to use, as compared to other scripting
languages.
2. Interpreted: It is an interpreted language, i.e. there is no need for compilation.
3. Faster: It is faster than other scripting languages e.g. JSP and ASP.
4. Open Source: Open source means you need not pay for use of PHP. You can
freely download and use it.
5. Platform Independent: PHP code will be run on every platform, Linux, Unix,
Mac OS X, Windows.
(2) What are the rules for declaring variables in PHP?
Answer :
Following are the rules for declaring variables in PHP:
1. A variable starts with the $ sign, followed by the name of the variable
2. A variable name must start with a letter or the underscore character
3. A variable name cannot start with a number
4. A variable name can only contain alpha-numeric characters and underscores
(A-z, 0-9, and_)
5. Variable names are case-sensitive ($age and $AGE are two different
variables)
(3) What is server-side scripting?
Answer :
Aafreen Shaikh(CSJC,Jalgaon)
1. A server is a computer system that serves as a central control of data and
programs shared by clients.
2. The server-side environment that runs a scripting language is termed a web
server.
3. A user's request is fulfilled by running a script directly on the web server.
4. It is used to provide interactive websites.
5. Programming languages for server-side programming are PHP, Python, JSP.
(4) List the supported data types in PHP.
Answer :
1. String: A string is a sequence of characters. A string can be any text inside
quotes. You can use single or double-quotes.
2. Integer: An integer data type is a non-decimal number between -2,147,483,648
and 2,147,483,647.
3. Float (floating point numbers): A float (floating-point number) is a number
with a decimal point or a number in exponential form.
4. Boolean: A Boolean represents two possible states. TRUE or FALSE.
5. Array: An array stores multiple values in one single variable.
6. NULL: Null is a special data type which can have only one value NULL. A
variable of data type NULL is a variable that has no value assigned to it.
(5) Explain any two string manipulation function.
Answer :
Function Description
strlen() Returns the length of a string (i.e. total no. of characters)
str_word_count()Counts the number of words in a string
strrev() Reverses a string
strpos()
Searches for a specific text within a string and returns the
character position of the first match and if no match is found, then
it will return false
str_replace() Replaces some characters with some other characters in a string
Q7. Write Programs for the following.
(1) Write a PHP code which calculates square of any number using form.
Answer :
Coding:
<html>
<body>
<form method="post">
Enter a Number
<input type="text" name="sq"><br><br>
Aafreen Shaikh(CSJC,Jalgaon)
<input type="submit" name="submit" value="Sqaure">
</form>
</body>
</html>
<?php
if(isset($_POST['submit']))
{
$sq= $_POST['sq'];
$s=$sq*$sq;
echo "<br><br> The Square of number is: ".$s;
}
?>
(2) Write Programs for the following.
Answer :
Coding:
<?php
$a="Hypertext Preprocessor";
echo "<br><br> String is ".$a;
echo" <br><br> Words in String is ".str_word_count($a);
?>
(3) Write Programs for the following.
Answer :
Coding:
Form.html
<html>
<body>
<form action="wc.php" method="post">
Enter Name
<input type="text" name="name"><br><br>
Enter Password
<input type="password" name="pass"><br><br>
<input type="submit" name= "submit" value="Submit">
</form>
</body>
</html>
wc.php
<html>
<body>
Welcome
<?php
echo $_POST["name"]; ?> <br><br>
Your Password is
<?php
echo $_POST["pass"];
?>

More Related Content

Similar to Maharashtra state board IT science Chap 5.pdf

Php intro by sami kz
Php intro by sami kzPhp intro by sami kz
Php intro by sami kzsami2244
 
PHP Training Part1
PHP Training Part1PHP Training Part1
PHP Training Part1than sare
 
Java apptitude-questions-part-1
Java apptitude-questions-part-1Java apptitude-questions-part-1
Java apptitude-questions-part-1vishvavidya
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopmentCarlosPineda729332
 
Chap1introppt1php basic
Chap1introppt1php basicChap1introppt1php basic
Chap1introppt1php basicmonikadeshmane
 
C interview question answer 1
C interview question answer 1C interview question answer 1
C interview question answer 1Amit Kapoor
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptxalehegn9
 
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive OverviewMohamed Loey
 
C language 100 questions answers
C language 100 questions answersC language 100 questions answers
C language 100 questions answerssakshitiwari631430
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHPPaul Houle
 
PHP Interview Questions
PHP Interview QuestionsPHP Interview Questions
PHP Interview QuestionsMaryamAnwar10
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
Introduction To PHP (Variables & Data types)
Introduction To PHP (Variables & Data types)Introduction To PHP (Variables & Data types)
Introduction To PHP (Variables & Data types)Sidrah Noor
 

Similar to Maharashtra state board IT science Chap 5.pdf (20)

Php intro by sami kz
Php intro by sami kzPhp intro by sami kz
Php intro by sami kz
 
PHP Training Part1
PHP Training Part1PHP Training Part1
PHP Training Part1
 
Learning php 7
Learning php 7Learning php 7
Learning php 7
 
Java apptitude-questions-part-1
Java apptitude-questions-part-1Java apptitude-questions-part-1
Java apptitude-questions-part-1
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment
 
Chap1introppt1php basic
Chap1introppt1php basicChap1introppt1php basic
Chap1introppt1php basic
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
 
C interview question answer 1
C interview question answer 1C interview question answer 1
C interview question answer 1
 
PYTHON 101.pptx
PYTHON 101.pptxPYTHON 101.pptx
PYTHON 101.pptx
 
chapter Two Server-side Script lang.pptx
chapter  Two Server-side Script lang.pptxchapter  Two Server-side Script lang.pptx
chapter Two Server-side Script lang.pptx
 
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive Overview
 
Php introduction
Php introductionPhp introduction
Php introduction
 
C language 100 questions answers
C language 100 questions answersC language 100 questions answers
C language 100 questions answers
 
Embrace dynamic PHP
Embrace dynamic PHPEmbrace dynamic PHP
Embrace dynamic PHP
 
PHP Interview Questions
PHP Interview QuestionsPHP Interview Questions
PHP Interview Questions
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
C++ programing lanuage
C++ programing lanuageC++ programing lanuage
C++ programing lanuage
 
Introduction To PHP (Variables & Data types)
Introduction To PHP (Variables & Data types)Introduction To PHP (Variables & Data types)
Introduction To PHP (Variables & Data types)
 
PHP Reviewer
PHP ReviewerPHP Reviewer
PHP Reviewer
 

More from AAFREEN SHAIKH

Hsc computer science Networking technology (1).pdf
Hsc computer science Networking technology (1).pdfHsc computer science Networking technology (1).pdf
Hsc computer science Networking technology (1).pdfAAFREEN SHAIKH
 
Hsc computer science chap 4.HTML2024.pdf
Hsc computer science chap 4.HTML2024.pdfHsc computer science chap 4.HTML2024.pdf
Hsc computer science chap 4.HTML2024.pdfAAFREEN SHAIKH
 
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfHsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfAAFREEN SHAIKH
 
Hsc computer science chap 1 Operating System (1).pdf
Hsc computer science chap 1 Operating System  (1).pdfHsc computer science chap 1 Operating System  (1).pdf
Hsc computer science chap 1 Operating System (1).pdfAAFREEN SHAIKH
 
Hsc IT 6. E-Commerce and E-Governance_.pdf
Hsc IT 6. E-Commerce and E-Governance_.pdfHsc IT 6. E-Commerce and E-Governance_.pdf
Hsc IT 6. E-Commerce and E-Governance_.pdfAAFREEN SHAIKH
 
Hac IT 4. Emerging Technologies (1).pdf
Hac IT 4. Emerging Technologies  (1).pdfHac IT 4. Emerging Technologies  (1).pdf
Hac IT 4. Emerging Technologies (1).pdfAAFREEN SHAIKH
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfAAFREEN SHAIKH
 
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdfAAFREEN SHAIKH
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdfAAFREEN SHAIKH
 
Maharashtra state board exam IT Chap 6.pdf
Maharashtra state board exam IT Chap 6.pdfMaharashtra state board exam IT Chap 6.pdf
Maharashtra state board exam IT Chap 6.pdfAAFREEN SHAIKH
 
Maharashtra state board IT science Chap 4.pdf
Maharashtra state board IT science Chap 4.pdfMaharashtra state board IT science Chap 4.pdf
Maharashtra state board IT science Chap 4.pdfAAFREEN SHAIKH
 
Maharashtra state board Hsc IT Chap 3.pdf
Maharashtra state board Hsc IT Chap 3.pdfMaharashtra state board Hsc IT Chap 3.pdf
Maharashtra state board Hsc IT Chap 3.pdfAAFREEN SHAIKH
 
Maharashtra state board Hsc IT Chap 1 advance web designing.pdf
Maharashtra state board Hsc IT Chap 1 advance web designing.pdfMaharashtra state board Hsc IT Chap 1 advance web designing.pdf
Maharashtra state board Hsc IT Chap 1 advance web designing.pdfAAFREEN SHAIKH
 
JAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfJAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfAAFREEN SHAIKH
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTAAFREEN SHAIKH
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdfAAFREEN SHAIKH
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdfAAFREEN SHAIKH
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfAAFREEN SHAIKH
 

More from AAFREEN SHAIKH (18)

Hsc computer science Networking technology (1).pdf
Hsc computer science Networking technology (1).pdfHsc computer science Networking technology (1).pdf
Hsc computer science Networking technology (1).pdf
 
Hsc computer science chap 4.HTML2024.pdf
Hsc computer science chap 4.HTML2024.pdfHsc computer science chap 4.HTML2024.pdf
Hsc computer science chap 4.HTML2024.pdf
 
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdfHsc computer science paper 1 chap 1 OperatingSystem2024.pdf
Hsc computer science paper 1 chap 1 OperatingSystem2024.pdf
 
Hsc computer science chap 1 Operating System (1).pdf
Hsc computer science chap 1 Operating System  (1).pdfHsc computer science chap 1 Operating System  (1).pdf
Hsc computer science chap 1 Operating System (1).pdf
 
Hsc IT 6. E-Commerce and E-Governance_.pdf
Hsc IT 6. E-Commerce and E-Governance_.pdfHsc IT 6. E-Commerce and E-Governance_.pdf
Hsc IT 6. E-Commerce and E-Governance_.pdf
 
Hac IT 4. Emerging Technologies (1).pdf
Hac IT 4. Emerging Technologies  (1).pdfHac IT 4. Emerging Technologies  (1).pdf
Hac IT 4. Emerging Technologies (1).pdf
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdf
 
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf
2. Introduction to SEO 2 (Search Engine Optimization) (12th IT).pdf
 
1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf1. Advanced Web Designing (12th IT) (1).pdf
1. Advanced Web Designing (12th IT) (1).pdf
 
Maharashtra state board exam IT Chap 6.pdf
Maharashtra state board exam IT Chap 6.pdfMaharashtra state board exam IT Chap 6.pdf
Maharashtra state board exam IT Chap 6.pdf
 
Maharashtra state board IT science Chap 4.pdf
Maharashtra state board IT science Chap 4.pdfMaharashtra state board IT science Chap 4.pdf
Maharashtra state board IT science Chap 4.pdf
 
Maharashtra state board Hsc IT Chap 3.pdf
Maharashtra state board Hsc IT Chap 3.pdfMaharashtra state board Hsc IT Chap 3.pdf
Maharashtra state board Hsc IT Chap 3.pdf
 
Maharashtra state board Hsc IT Chap 1 advance web designing.pdf
Maharashtra state board Hsc IT Chap 1 advance web designing.pdfMaharashtra state board Hsc IT Chap 1 advance web designing.pdf
Maharashtra state board Hsc IT Chap 1 advance web designing.pdf
 
JAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdfJAVASCRIPT PROGRAM.pdf
JAVASCRIPT PROGRAM.pdf
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART II.pdf
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART I.pdf
 
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdfHSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
HSC INFORMATION TECHNOLOGY CHAPTER 1 ADVANCED WEB DESIGNING PART III.pdf
 

Recently uploaded

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Maharashtra state board IT science Chap 5.pdf

  • 1. Aafreen Shaikh(CSJC,Jalgaon) Chapter 5 Server-Side Scripting (PHP) Textbook Solutions Fill in the blanks. (1) PHP is __________ side scripting language. Answer : Server (2) PHP is _________ language i.e. there is no need for compilation. Answer : interpreted (3) A variable starts with __________ sign followed by variable name. Answer : $ (4) An _________ is a variable, which can hold more than one value at a time. Answer : array (5) Information can be passed to functions through ___________. Answer : arguments State True/False (1) PHP is platform dependent scripting language. • True • False Answer : False (2) $_POST is an array of variables passed via the URL parameters. • True • False Answer : False (3) A Function is a block of statements that can be used repeatedly in a program. • True • False
  • 2. Aafreen Shaikh(CSJC,Jalgaon) Answer : True (4) PHP cannot be embedded along with HTML tags. • True • False Answer : False (5) GET should NEVER be used for sending sensitive information. • True • False Answer : True Multiple Choice Question (1 correct) (1) The program file of PHP havev _________ extension. • .asp • .php • .js • .txt Answer : .php (2) A variable declared ___________ a function has global scope. • outside • anywhere • inside • none Answer : outside (3) The ____________ function returns a part of a string. • trim() • ucwords() • substr() • strpos() Answer : substr() Multiple Choice Question. (2 correct) (1) The _________ and _________ are valid data types in PHP.
  • 3. Aafreen Shaikh(CSJC,Jalgaon) a) Double b) Varchar c) Integer d) Array e) Biglnt Answer : Integer and Array (2) Single line comment in PHP is possible using _______, __________. a) // b) /* */ c) # d) <!-- --> e) $ Answer : // and /* */. Multiple Choice Question. (3 correct) (1) ln PHP, three types of arrays are ________, _________, __________. a) Indexed b) Simple c) Associative d) Multidimensional e) Complex f) General Answer : Indexed, Associative, Multidimensional. (2) The scope of variable can be _______, _______, ______. a) local b) global
  • 4. Aafreen Shaikh(CSJC,Jalgaon) c) universal d) static e) final f) outside Answer : local, global, static. Brief Questions. (1) Explain any two features of PHP? Answer : PHP is the most popular and frequently used worldwide server-side scripting language. Following are features of PHP: 1. Simple: It is very simple and easy to use, as compared to other scripting languages. 2. Interpreted: It is an interpreted language, i.e. there is no need for compilation. 3. Faster: It is faster than other scripting languages e.g. JSP and ASP. 4. Open Source: Open source means you need not pay for use of PHP. You can freely download and use it. 5. Platform Independent: PHP code will be run on every platform, Linux, Unix, Mac OS X, Windows. (2) What are the rules for declaring variables in PHP? Answer : Following are the rules for declaring variables in PHP: 1. A variable starts with the $ sign, followed by the name of the variable 2. A variable name must start with a letter or the underscore character 3. A variable name cannot start with a number 4. A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and_) 5. Variable names are case-sensitive ($age and $AGE are two different variables) (3) What is server-side scripting? Answer :
  • 5. Aafreen Shaikh(CSJC,Jalgaon) 1. A server is a computer system that serves as a central control of data and programs shared by clients. 2. The server-side environment that runs a scripting language is termed a web server. 3. A user's request is fulfilled by running a script directly on the web server. 4. It is used to provide interactive websites. 5. Programming languages for server-side programming are PHP, Python, JSP. (4) List the supported data types in PHP. Answer : 1. String: A string is a sequence of characters. A string can be any text inside quotes. You can use single or double-quotes. 2. Integer: An integer data type is a non-decimal number between -2,147,483,648 and 2,147,483,647. 3. Float (floating point numbers): A float (floating-point number) is a number with a decimal point or a number in exponential form. 4. Boolean: A Boolean represents two possible states. TRUE or FALSE. 5. Array: An array stores multiple values in one single variable. 6. NULL: Null is a special data type which can have only one value NULL. A variable of data type NULL is a variable that has no value assigned to it. (5) Explain any two string manipulation function. Answer : Function Description strlen() Returns the length of a string (i.e. total no. of characters) str_word_count()Counts the number of words in a string strrev() Reverses a string strpos() Searches for a specific text within a string and returns the character position of the first match and if no match is found, then it will return false str_replace() Replaces some characters with some other characters in a string Q7. Write Programs for the following. (1) Write a PHP code which calculates square of any number using form. Answer : Coding: <html> <body> <form method="post"> Enter a Number <input type="text" name="sq"><br><br>
  • 6. Aafreen Shaikh(CSJC,Jalgaon) <input type="submit" name="submit" value="Sqaure"> </form> </body> </html> <?php if(isset($_POST['submit'])) { $sq= $_POST['sq']; $s=$sq*$sq; echo "<br><br> The Square of number is: ".$s; } ?> (2) Write Programs for the following. Answer : Coding: <?php $a="Hypertext Preprocessor"; echo "<br><br> String is ".$a; echo" <br><br> Words in String is ".str_word_count($a); ?> (3) Write Programs for the following. Answer : Coding: Form.html <html> <body> <form action="wc.php" method="post"> Enter Name <input type="text" name="name"><br><br> Enter Password <input type="password" name="pass"><br><br> <input type="submit" name= "submit" value="Submit"> </form> </body> </html> wc.php <html> <body> Welcome <?php echo $_POST["name"]; ?> <br><br> Your Password is <?php echo $_POST["pass"]; ?>