1) Explain about PHP?
Personal home page language is used to create dynamic and interactive websites which are very efficient in delivering client needs from the server side. This language is widely used. It is used on various operating systems with Apache modules. This can be directly embedded into HTML code.
Personal home page language is used to create dynamic and interactive websites which are very efficient in delivering client needs from the server side. This language is widely used. It is used on various operating systems with Apache modules. This can be directly embedded into HTML code.
2) Explain about the installation of PHP on UNIX systems?
PHP can be installed on UNIX in many different ways there are pre defined packages available which can ease the process. Initially it can be controlled by the command line options. Help can be obtained from./configure help command. After installing PHP modules or executables can be configures and make command should help you in the process.
PHP can be installed on UNIX in many different ways there are pre defined packages available which can ease the process. Initially it can be controlled by the command line options. Help can be obtained from./configure help command. After installing PHP modules or executables can be configures and make command should help you in the process.
3) How to enable parsing?
Parsing is an important concept if you want to run your code appropriately and timely. PHP parses all the code present between the opening and closing tags, it ignores everything present out of the closing and opening tags. This tags allow PHP to be embedded between many documents.
Parsing is an important concept if you want to run your code appropriately and timely. PHP parses all the code present between the opening and closing tags, it ignores everything present out of the closing and opening tags. This tags allow PHP to be embedded between many documents.
4) What are the different opening and closing tags available in PHP?
There are four different types of tags available in PHP they are
*
*
There are four different types of tags available in PHP they are
*
*
* PHP short tags
* ASP style tags.
Generally the first two tags are widely used because they are portable.
* ASP style tags.
Generally the first two tags are widely used because they are portable.
5) Explain about array uintersect()?
This function is very useful in PHP. This function compares array values in a user defined function and it returns the array. If assoc() is added to the function it compares array keys. This function can also be defined as array uintersect uassoc().
This function is very useful in PHP. This function compares array values in a user defined function and it returns the array. If assoc() is added to the function it compares array keys. This function can also be defined as array uintersect uassoc().
6) Explain about converting an object?
When an object is converted into an object the stance of the object is not modified. A new instance of the class is created if a value of different type if converted into an object. Incase the value is null at the time of conversion the new instance will be empty.
When an object is converted into an object the stance of the object is not modified. A new instance of the class is created if a value of different type if converted into an object. Incase the value is null at the time of conversion the new instance will be empty.
7) Explain about resource?
Resource holds reference to an external resource and it is a special variable. These are created and used by specially defined functions. Resource holds defined and special handlers for opening files. Converting to a resource makes no sense at all.
Resource holds reference to an external resource and it is a special variable. These are created and used by specially defined functions. Resource holds defined and special handlers for opening files. Converting to a resource makes no sense at all.
8) Explain about null?
Null represents a variable with no value inside. There doesn’t exist any value for type Null. Null is defined to be null if and only if it is assigned a constant null, there is no value set, it is set to be unset(). This is the case insensitive keyword. There are also two functions they are is_null and unset().
Null represents a variable with no value inside. There doesn’t exist any value for type Null. Null is defined to be null if and only if it is assigned a constant null, there is no value set, it is set to be unset(). This is the case insensitive keyword. There are also two functions they are is_null and unset().
9) Explain about mixed and callback functions?
Mixed function indicates that the function may contain multiple types but it doesn’t form a necessary condition. Functions like call_user_func() or usort() accept user defined functions as parameter. These functions are not only simple but also object methods which includes static methods.
Mixed function indicates that the function may contain multiple types but it doesn’t form a necessary condition. Functions like call_user_func() or usort() accept user defined functions as parameter. These functions are not only simple but also object methods which includes static methods.
10) Explain about PHP looping?
Looping statements are used in PHP to execute the code for a developer defined number of times. PHP has these following looping statements they are while, do while, for and for each. Foreach is used to loop a block of code in each element in an array.
Looping statements are used in PHP to execute the code for a developer defined number of times. PHP has these following looping statements they are while, do while, for and for each. Foreach is used to loop a block of code in each element in an array.
11) Explain about Booleans in PHP?
A Boolean type states a truth value whether it is true or false. These statements are case insensitive. An operator returns a Boolean value and this value is passed onto the control structure which executes the statement. If an argument is required it is automatically converted.
A Boolean type states a truth value whether it is true or false. These statements are case insensitive. An operator returns a Boolean value and this value is passed onto the control structure which executes the statement. If an argument is required it is automatically converted.
12) Explain about Type juggling?
PHP uses Type juggling similar to the way Perl uses. Variable is defined in the context in which it is used. It doesn’t require any explicit definition for a function to perform its duties. For example if a string value is assigned to a variable it is defined as string.
PHP uses Type juggling similar to the way Perl uses. Variable is defined in the context in which it is used. It doesn’t require any explicit definition for a function to perform its duties. For example if a string value is assigned to a variable it is defined as string.
13) Explain about the casts allowed in PHP?
Type casting acts and functions similarly as it performs in C. The casts allowed are Integer, Boolean, float and double, string, binary, array and object. Casting and support was added in PHP 5.2.1. A variable can be enclosed in double quotes instead of casting it to a string.
Type casting acts and functions similarly as it performs in C. The casts allowed are Integer, Boolean, float and double, string, binary, array and object. Casting and support was added in PHP 5.2.1. A variable can be enclosed in double quotes instead of casting it to a string.
14) How to change the principal password?
Principal password can be changed by using kadm5_chpass_principal command. If you also want to specify the new password for effecting a change to the principal password it should be as
Bool kadm5_chpass_principal (resource $handle, string $principal, string password). This changes the password to password.
Principal password can be changed by using kadm5_chpass_principal command. If you also want to specify the new password for effecting a change to the principal password it should be as
Bool kadm5_chpass_principal (resource $handle, string $principal, string password). This changes the password to password.
15) Explain about the advantages of using PHP?
There are many advantages of PHP they are
1) Easy and fast creation of dynamic web pages and a developer can also embed these dynamic functions into HTML.
2) A huge community resource which has a ton of information before you.
3) Connectivity ability lets you to connect to different interfaces and predefined libraries.
4) Execution is very fast because it uses less system resources, etc.
There are many advantages of PHP they are
1) Easy and fast creation of dynamic web pages and a developer can also embed these dynamic functions into HTML.
2) A huge community resource which has a ton of information before you.
3) Connectivity ability lets you to connect to different interfaces and predefined libraries.
4) Execution is very fast because it uses less system resources, etc.
16) Explain about the connective abilities of the PHP?
A huge advantage for PHP is its connective ability. It uses huge number of extensions to interface with huge pool of libraries such as XML, graphics and encryption. Programmers can create their own extensions and compiling them. They can load their own programs by using the dynamic loading mechanism.
A huge advantage for PHP is its connective ability. It uses huge number of extensions to interface with huge pool of libraries such as XML, graphics and encryption. Programmers can create their own extensions and compiling them. They can load their own programs by using the dynamic loading mechanism.
17) How can MYSQL functions be available with PHP?
MYSQL is not available as a default feature it must be created by the user. You can use --with-mysql=DIR function to make available SQL on your system. Compiling PHP functions with MYSQL will increase the support and functioning of the language. MYSQL should be installed where there are extensions of PHP.
MYSQL is not available as a default feature it must be created by the user. You can use --with-mysql=DIR function to make available SQL on your system. Compiling PHP functions with MYSQL will increase the support and functioning of the language. MYSQL should be installed where there are extensions of PHP.
1) What exactly is PHP ?
PHP is also known as personal home page. PHP is used for producing dynamic WebPages. This language can be used for varied types of scripting such as server side scripting, standalone and for graphical applications. This is released under PHP license and is considered to be free software.
PHP is also known as personal home page. PHP is used for producing dynamic WebPages. This language can be used for varied types of scripting such as server side scripting, standalone and for graphical applications. This is released under PHP license and is considered to be free software.
2) Describe about the security vulnerability of PHP?
According to the information obtained from the National vulnerability database, PHP has more than quarter of the software vulnerabilities discovered in 2008. Out of 33.33% software and scripts vulnerability PHP amounts to almost quarter of them. Register_globals a feature present in PHP is responsible for most of these vulnerabilities and now it is deprecated by PHP. Most of these security vulnerabilities occur due to poor programming techniques.
According to the information obtained from the National vulnerability database, PHP has more than quarter of the software vulnerabilities discovered in 2008. Out of 33.33% software and scripts vulnerability PHP amounts to almost quarter of them. Register_globals a feature present in PHP is responsible for most of these vulnerabilities and now it is deprecated by PHP. Most of these security vulnerabilities occur due to poor programming techniques.
3) Explain about the data types in PHP?
PHP stores information numerical in a platform dependent range. Unsigned integers can be easily converted to signed integers. Decimal, octal, and hexadecimal notations can be easily assigned to integers. Floating point notation and two forms of scientific notation can be easily assigned to Real numbers. Zero is considered as false and all non zero numbers are considered as true.
PHP stores information numerical in a platform dependent range. Unsigned integers can be easily converted to signed integers. Decimal, octal, and hexadecimal notations can be easily assigned to integers. Floating point notation and two forms of scientific notation can be easily assigned to Real numbers. Zero is considered as false and all non zero numbers are considered as true.
4) Explain about Functions in PHP?
PHP has a large pool of functions and a huge number of them can be created by extensions. These functions can be defined at runtime by defining them inside the code. These functions have to be defined inside the parenthesis except for a class constructor function where there is no argument. Functions can be called or referenced by specifying their name.
PHP has a large pool of functions and a huge number of them can be created by extensions. These functions can be defined at runtime by defining them inside the code. These functions have to be defined inside the parenthesis except for a class constructor function where there is no argument. Functions can be called or referenced by specifying their name.
5) Explain about objects in PHP?
In previous versions of PHP, object was fully copied before assigning a variable to a method. This problem was solved in new versions of PHP by the handle function. Many of the features present in PHP 5 are adopted from C++. Some of the features which are incorporated are restricted classes such as private and public, abstract and final classes, abstract and final methods, constructors and destructors with exception handling borrowed from C++.
In previous versions of PHP, object was fully copied before assigning a variable to a method. This problem was solved in new versions of PHP by the handle function. Many of the features present in PHP 5 are adopted from C++. Some of the features which are incorporated are restricted classes such as private and public, abstract and final classes, abstract and final methods, constructors and destructors with exception handling borrowed from C++.
6) What is a PHP accelerator?
PHP accelerator increases the speed of applications written in PHP. This boost of performance can be around 2-10 times. PHP accelerator increases the speed of the applications by decreasing parsing each and every time a PHP application runs. It depends upon factors such as time taken for execution of the PHP script and the actual percentage of the source code requested.
PHP accelerator increases the speed of applications written in PHP. This boost of performance can be around 2-10 times. PHP accelerator increases the speed of the applications by decreasing parsing each and every time a PHP application runs. It depends upon factors such as time taken for execution of the PHP script and the actual percentage of the source code requested.
7) Explain about the $_GET variable of PHP?
This GET variable is executed when a request is sent from the user for information. This GET gets executed on the server and then information is sent back to the user. The information transmitted through this GET variable is viewable by everyone and is displayed in the address bar of the browser. A maximum of 100 characters is sent by the GET variable.
This GET variable is executed when a request is sent from the user for information. This GET gets executed on the server and then information is sent back to the user. The information transmitted through this GET variable is viewable by everyone and is displayed in the address bar of the browser. A maximum of 100 characters is sent by the GET variable.
8) Explain about PHP cookies?
A Cookie is placed on the user desktop which uniquely identifies the user and every time a user views the webpage the same cookie is retrieved. With PHP a programmer can create and retrieve information simultaneously. The setcookie() function is used to create a cookie and PHP $_COOKIE variable helps the programmer to retrieve the cookie stored on the users computer. These both functions can function simultaneously.
A Cookie is placed on the user desktop which uniquely identifies the user and every time a user views the webpage the same cookie is retrieved. With PHP a programmer can create and retrieve information simultaneously. The setcookie() function is used to create a cookie and PHP $_COOKIE variable helps the programmer to retrieve the cookie stored on the users computer. These both functions can function simultaneously.
9) Describe about PHP error and logging information?
Error handling function allows the user to detect the error and do necessary changes which paved the way for the error.
Logging functions pave the way for users to use log applications and send messages to system logs, email or for other specific purpose.
PHP has efficient error and logging constants to its credit. Some of them are E_ERROR, E_NOTICE, E_ALL, E_STRICT, etc.
Error handling function allows the user to detect the error and do necessary changes which paved the way for the error.
Logging functions pave the way for users to use log applications and send messages to system logs, email or for other specific purpose.
PHP has efficient error and logging constants to its credit. Some of them are E_ERROR, E_NOTICE, E_ALL, E_STRICT, etc.
10) Name and explain five of the PHP error constants?
Some of the five PHP error constants are E_ERROR, E_WARNING, E_PARSE, E_USER_WARNING, E_COMPILE_WARNING, etc
E_ERROR: -This error is displayed when there is fatal error which halts the execution of the script immediately.
E_WARNING: -This warns the programmer about the error but the execution of the script is not stopped.
E_PARSE: -These errors occur during compile time and these errors should only be generated by the parser.
E_USER_WARNING: -This warning error is generated by the user and is non fatal. This is set by the programmer using trigger_error().
E_COMPILE_WARNING: -this error is generated by the Zend scripting engine. This is a compile time non fatal error.
Some of the five PHP error constants are E_ERROR, E_WARNING, E_PARSE, E_USER_WARNING, E_COMPILE_WARNING, etc
E_ERROR: -This error is displayed when there is fatal error which halts the execution of the script immediately.
E_WARNING: -This warns the programmer about the error but the execution of the script is not stopped.
E_PARSE: -These errors occur during compile time and these errors should only be generated by the parser.
E_USER_WARNING: -This warning error is generated by the user and is non fatal. This is set by the programmer using trigger_error().
E_COMPILE_WARNING: -this error is generated by the Zend scripting engine. This is a compile time non fatal error.
11) Explain about looping in PHP?
Looping is used to run the same script many number of times. Following statements are used in PHP for looping while, do...while, for each, and for statement.
Looping is used to run the same script many number of times. Following statements are used in PHP for looping while, do...while, for each, and for statement.
12) Explain about require and include function?
Include function collects all the text in a defined specific file and copies the text information to the file which has the include function in it
Require function is similar to the include function except that it handles the error system in a different manner. Require function displays a fatal error and stops the execution of the script while the include function still executes the script.
Include function collects all the text in a defined specific file and copies the text information to the file which has the include function in it
Require function is similar to the include function except that it handles the error system in a different manner. Require function displays a fatal error and stops the execution of the script while the include function still executes the script.
13) Define about declare construct?
Declare construct allows you to define execution directives for a block set of code. This actually describes the way the code should perform. These declare construct can be set in such a manner that all the code is affected. The way the code performs can be set by the directive part which directly leads the code to follow.
Declare construct allows you to define execution directives for a block set of code. This actually describes the way the code should perform. These declare construct can be set in such a manner that all the code is affected. The way the code performs can be set by the directive part which directly leads the code to follow.
14) What is the alternative structure for control structures?
The basic control structures are if, for, while, do while, for each and switch. If you are planning to use alternative structures then the closing braces should be changed to endif, endfor, endwhile, endswitch, and endforeach. Similarly the opening brace of the alternative syntax should be changed to (:) or colon. The alternative structure is applicable to else and elseif also.
The basic control structures are if, for, while, do while, for each and switch. If you are planning to use alternative structures then the closing braces should be changed to endif, endfor, endwhile, endswitch, and endforeach. Similarly the opening brace of the alternative syntax should be changed to (:) or colon. The alternative structure is applicable to else and elseif also.
15) Explain about switch statement in PHP?
Switch statement is executed line by line. PHP executes the statement only when the case statement matches the value of the switch expression. It does execute the statement until the end of the block till it finds the break statement. When the expression and statement matches themselves the code is executed.
Switch statement is executed line by line. PHP executes the statement only when the case statement matches the value of the switch expression. It does execute the statement until the end of the block till it finds the break statement. When the expression and statement matches themselves the code is executed.
16) Explain about PHP filter and why it should be used?
A PHP filter validates, filters according to the predefined statements from the programmer. It is very important for every programmer to validate user defines information as it can potential harm; PHP eliminated this risk by using PHP filter extension. This forms a good security practice for programmers.
A PHP filter validates, filters according to the predefined statements from the programmer. It is very important for every programmer to validate user defines information as it can potential harm; PHP eliminated this risk by using PHP filter extension. This forms a good security practice for programmers.
17) What are the different filter functions used to filter a variable?
T filter a variable these are the following different functions used they are: -
1) Filter_var()
2) Filter_var_array()
3) Filter_input
4) Filter_input_array
T filter a variable these are the following different functions used they are: -
1) Filter_var()
2) Filter_var_array()
3) Filter_input
4) Filter_input_array
18) What exactly is validating and sanitizing?
Validating and sanitizing are two different kinds of filters
Validating filters: - These filters are used to validate user sent information (input). Strict rules are applied for formatting such as URL or Email validating. It also sends the success type for a particular operation whether false or true.
Sanitizing filters: - These filters are used to allow or disallow specific characters present in a string. There are no restrictions on data format rules. This filter always returns the string.
Validating and sanitizing are two different kinds of filters
Validating filters: - These filters are used to validate user sent information (input). Strict rules are applied for formatting such as URL or Email validating. It also sends the success type for a particular operation whether false or true.
Sanitizing filters: - These filters are used to allow or disallow specific characters present in a string. There are no restrictions on data format rules. This filter always returns the string.