Professional Documents
Culture Documents
A static website is one that is written in HTML only. Each page is a separate
document and there is no database that it draws on. What this means
functionally is that the only way to edit the site is to go into each page and edit
the HTML
dynamic website is created by webdevelopers who are strong in ASP.Net,
PHP, JAVA and more... This website pages contains data is retrieved from
certain database. Each time the viewer entering a page, the contents of that
page is retrieved from the database.
One of the main reasons that businesses choose PHP is its simplicity and ease of
use.
PHP commands are simply embedded into the same web page with HTML
commands, and execute on the server to deliver the web pages to the user.
What are the differences between GET and POST methods in form submitting?
On the server side, the main difference between GET and POST is where
the submitted is stored. The $_GET array stores data submitted by the GET
method. The $_POST array stores data submitted by the POST method.
On the browser side, the difference is that data submitted by the GET method
will be displayed in the browser’s address field. Data submitted by the POST
method will not be displayed anywhere on the browser.
GET method is mostly used for submitting a small amount and less sensitive
data.
POST method is mostly used for submitting a large amount or sensitive data.
What is a Session?
sizeof($array_var)
count($array_var)
mysql_fetch_object:
Returns an object with properties that correspond to the fetched row and moves
the internal data pointer ahead. Returns an object with properties that
correspond to the fetched row, or FALSE if there are no more rows.
mysql_fetch_row():
Fetches one row of data from the result associated with the specified result
identifier. The row is returned as an array. Each result column is stored in an array
offset, starting at offset 0.we just pass a simple var instead of a an array it will
return 1.
$file = fopen("file.txt","r");
?>
Answers : Split function splits string into array by regular expression. Explode splits a string into array by
string.
How do you connet mysql database with PHP ? Answers :We can
connect Mysql Database with PHP using both Procedural and Object oriented style like below
$link = mysqli_connect(“localhost”, “username”, “password”, “dbofpcds”);
mysql_select_db(“database”,$link);
In how many ways we can retrieve the data in the result set
of MySQL using PHP? What is the difference between
mysql_fetch_object and mysql_fetch_array ?
Answers :we can retrieve the data in the result set of MySQL using PHP in 4 Ways
Explain mysql_error().
The mysql_error() message will tell us what was wrong with our query, similar to the message
we would receive at the MySQL console.
2. when we use GET method requested data show in url but Not in POST method so POST method is
good for send sensetive request
What is PHP ?
PHP is an open-source, interpreted, and object-oriented scripting language that can be executed
at the server-side.
open-source
What is Object Oriented Programming?
Object oriented programming is a programming technique to design your
application. Application can be of any type like it can be web based application,
windows based application etc.
In n object oriented programming, everything revolves around the objects and
class.object oriented programming, everything revolves around the o
What is a class?
What is an object?
Objects are created from Classes, is an instance of a class that is created
dynamically.
Object in programming is similar to real word object. Every programming object
has some properties and behaviors.
What is the relation between Classes and Objects?
They look very much same but are not same.
1. Default constructor
1. Encapsulation is used to hide the values or state of a structured data object inside a class,
preventing unauthorized parties' direct access to them.
2. Visibility is the mechanism for encapsulation.
What is Abstraction?
Abstraction is a concept in which implementation details are hidden.
Explain about polymorphism?
It is simply "One thing, can use in different forms". Technically, it is the ability to redefine
methods for derived classes.
#Example: One Class (Car) can extend two classes (Audi & BMW)
Types of Polymorphism?
Polymorphism could be static and dynamic both. Overloading is static polymorphism
while, overriding is dynamic polymorphism.
The differences are : echo has no return value while print has a return value of 1 so it can be
used in expressions.
Integer
Boolean
Array
NULL
Resource
Reverse a String
strrev() - Reverse a String
To create a constant,
use the define() function
global variables
PHP super global variables are available in all scopes throughout a script.
$_SERVER
$_REQUEST
$_POST
$_GET
$_FILES
$_ENV
$_COOKIE
$_SESSION
PHP $GLOBALS
$GLOBALS is a PHP super global variable which is used to access global variables from anywhere
in the PHP script.
PHP $_SERVER
$_SERVER is a PHP super global variable which holds information about headers, paths, and
script locations.
Elements of $_SERVER
Information sent from a form with the GET method is visible to everyone (all variable names and
values are displayed in the URL). GET also has limits on the amount of information to send. (Only
2000 characters)
$_GET is an array of variables passed to the current script via the URL parameters.
Information sent from a form with the POST method is invisible to others and has no limits on
the amount of information to send.
$_POST is an array of variables passed to the current script via the HTTP POST method.
PHP $_REQUEST
But in case of function overriding, more than one functions will have same method signature
and number of arguments
Oriented programming takes a radically different approach:Code and data are merged into one
indivisible item – an object (the term “component” has also been used to describe an object.) An object
is an abstraction of a set of real-world things (for example, an object may be created around “date”) The
object would contain all information and functionality for that thing