Aakash PHP Complete Solved Solutions For Previous Year Question Papers of PHP Web Based
Aakash PHP Complete Solved Solutions For Previous Year Question Papers of PHP Web Based
Some text,
The require() Function
‘The require() function takes all the text in a specified file and copies it into the file
that uses the include function. If there is any problem in loading a file then
the require() function generates a fatal error and halt the execution of the script.
So there is no difference in require() and include() except they handle error conditions.
Itis recommended to use the require() function instead of include(), because scripts should
not continue executing if files are missing or misnamed.
‘Syntax:
require ‘filename’,
Q. 1. G) What is printf function and difference between echo and print
statement in PHP?
Ans. Refer Qno.1.(b) of end term exam 2017
Q. 1. G) Explain PHP with its feature?
‘Ans. It is open source scripting language so you can free download this an
PHPis a server site scripting language. Itis open source scripting language. It is
used all over the world. Itis faster than other scripting language. Some important!=
Fifth Semester, Web Based Programming
4-2015
Platform Independent
Famonde one Monitoring
Features of php: It is most popular and frequently used worldwide scripting
the main reason of popularity is; It is open source and very simple.
% Simple ; Faster; Interpreted; Open Source; Case Sensitive ; Simplicity ; Efficiency
«Platform Independent; Security; Flexibility; Familiarity; Error Reporting ; Loosely
‘Typed Language; Real-Time Access Monitoring
‘Simple: It is very simple and easy to use, compare to other scripting language itis
‘very simple and easy, this is widely used all over the world.
Interpreted: Itis an interpreted language, ie. there is no need for compilation.
Faster: It is faster than other scripting language e.g. asp and jsp-
Open Source : Open source means you no need to pay for use php,
download and use.
Platform Independent: PHP code will be run on every platform, Linux, Unix, Mac
OSX, Windows.
~ Gase Sensitive: PHP is case sensitive scripting language at time’of variable
else, while, echo, etc.), classes, functions, and
you can free
"declaration. In PHP, all keywords (e..
defined functions are NOT case-sensitive.
‘Access Monitoring: PHP provides access logging by creating the
of recent accesses for the user.
‘Typed Language: PHP supports variable usage without declaring its data
‘taken at the time of the execution based on the type of data it has onits
the different functions for Sorting an Array?
potions:LP. University-[BCA}-Akash Books 2015-5
Q. 2.(b) Difference between Client side scripting with server side scripting
Ans. Client-side Environment : The client-side environment used to run seripts
is usually a browser. The processing takes place on the end users computer. The source
code is transferred from the web server to the users computer over the internet and run
directly in the browser.
The scripting language needs to be enabled on the client computer. Sometimes if a
user is conscious of security risks they may switch the scripting facility off. When this
is the case a message usually pops up to alert the user when script is attempting to run.
Server-side Environment ; The server-side environment that runs a scripting
language is a web server. A user's request is fulfilled by running a script directly on the
web server to generate dynamic HTML pages. This HTML is then sent to the client
browser, It is usually used to provide interactive web sites that interface to databases
or other data stores on the server.
‘This is different from client-side scripting where scripts are run by the viewing web
browser, usually in JavaScript. The primary advantage to server-side scripting is the
ability to highly customize the response based on the user's requirements, access rights,
or queries into data stores.
Comparison between client-side and server-side scripting
Server-side scripting
* Response from a server-side script is slower because the scripts are processed
remotely.
ee Examples for server side scripting languages: PHP, JSP, ASP, Asp. Net, Ruby,
ete.
+ Server side scripting is used to connect to the databases that is on web server.
Client-side scripting
‘+ Response from a client-side seriptis faster because the scripts are processed on
the local computer.
* Client side scripting languages: Javascript, VB script, ete.
+ Cannot connect to the databases on the web server.
Q. 3. (a) Explain HTML and differentiate GET and POST form submission
methods with example?
Ans. Hypertext Markup Language (HTML) is the standard markup language for
creating web pages and web applications. With Cascading Style Sheets (CSS)
and JavaScript.
HTML elements are the building blocks of HTML pages. With HTML
constructs, images and other objects such as interactive forms may be embedded into
the rendered page. HTML provides a means to create structured doc b
structural semantics for text such as headings, paragraphs, lis
items. HTML elements are delineated by tags, written using.
as and directly introduce content into
as
surround and provide information about document tags as sub-elements. Browsers do not display the HTML tag the content of the page. HTML can embed programs written in a scripting which affects the behaviour and content of web pages. n of content.6-2015, Fifth Semester, Web Based Programming * GET * POST ‘The GET Method GET is used to request data from a specified resource. GET is one of the most common HTTP methods. * GET requests can be cached * GET requests remain in the browser history * GET requests can be bookmarked P * GET requests should never be used whemdealing with sensitive data * GET requests have length restrictions * GET requests is only used to request data (not modify) ‘The POST Method ft POST is used to send data to a server to create/update a resource. * POST requests are never cached ‘+ POST requests do not remain in the browser history * POST requests cannot be bookmarked + POST requests have no restrictions on data length ' ‘The PHP superglobals $_GET and $_POST are used to collect form-data. Example: of post Welcome. php code is below
Welcome