-
- 1. Who Is The Father Of Php And Explain The Changes In Php Versions?
Rasmus Lerdorf is known as the father of PHP. PHP/FI 2.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2.0 and is a lot nicer. PHP 4 is the current generation of PHP, which uses the Zend engine under the hood. PHP 5 uses Zend engine 2 which, among other things, offers many additional OOP features
- 1. Who Is The Father Of Php And Explain The Changes In Php Versions?
-
- 2. How Can We Submit A Form Without A Submit Button?
The main idea behind this is to use Java script submit() function in order to submit the form without explicitly clicking any submit button. You can attach the document.formname.submit() method to onclick, onchange events of different inputs and perform the form submission. you can even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites).
- 2. How Can We Submit A Form Without A Submit Button?
PHP Interview Questions
-
- 3. In How Many Ways We Can Retrieve The Data In The Result Set Of Mysql Using Php?
You can do it by 4 Ways- mysql_fetch_row.
- mysql_fetch_array
- mysql_fetch_object
- mysql_fetch_assoc
- 3. In How Many Ways We Can Retrieve The Data In The Result Set Of Mysql Using Php?
-
- 4. What Is The Difference Between Mysql_fetch_object And Mysql_fetch_array?
mysql_fetch_object() is similar to mysql_fetch_array(), with one difference – an object is returned, instead of an array. Indirectly, that means that you can only access the data by the field names, and not by their offsets (numbers are illegal property names).
- 4. What Is The Difference Between Mysql_fetch_object And Mysql_fetch_array?
PHP Tutorial
-
- 5. What Is The Difference Between $message And $$message?
It is a classic example of PHP’s variable variables. take the following example.$message = “Mizan”;$$message = “is a moderator of PHPXperts.”;$message is a simple PHP variable that we are used to. But the $$message is not a very familiar face. It creates a variable name $mizan with the value “is a moderator of PHPXperts.” assigned. break it like this${$message} => $mizanSometimes it is convenient to be able to have variable variable names. That is, a variable name which can be set and used dynamically.
- 5. What Is The Difference Between $message And $$message?
MySQL Interview Questions
-
- 6. How Can We Create A Database Using Php And Mysql?
We can create MySQL database with the use of mysql_create_db(“Database Name”)
- 6. How Can We Create A Database Using Php And Mysql?
-
- 7. Can We Use Include (“abc.php”) Two Times In A Php Page “makeit.php”?
Yes we can use include() more than one time in any page though it is not a very good practice.
- 7. Can We Use Include (“abc.php”) Two Times In A Php Page “makeit.php”?
MySQL Tutorial
Drupal Interview Questions
-
- 8. What Are The Different Tables Present In Mysql, Which Type Of Table Is Generated When We Are Creating A Table In The Following Syntax:
Create Table Employee (eno Int(2),ename Varchar(10)) ?
Total 5 types of tables we can create- MyISAM
- Heap
- Merge
- INNO DB
- ISAM
MyISAM is the default storage engine as of MySQL 3.23 and as a result if we do not specify the table name explicitly it will be assigned to the default engine.
- 8. What Are The Different Tables Present In Mysql, Which Type Of Table Is Generated When We Are Creating A Table In The Following Syntax:
-
- 9. Functions In Imap, Pop3 And Ldap?
You can find these specific information in PHP Manual.
- 9. Functions In Imap, Pop3 And Ldap?
MYSQL DBA Interview Questions
-
- 10. How Can I Execute A Php Script Using Command Line?
As of version 4.3.0, PHP supports a new SAPI type (Server Application Programming Interface) named CLI which means Command Line Interface. Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
- 10. How Can I Execute A Php Script Using Command Line?
Drupal Tutorial
-
- 11. Suppose Your Zend Engine Supports The Mode <? ?> Then How Can U Configure Your Php Zend Engine To Support Mode ?
In php.ini file: set short_open_tag=on
to make PHP support
- 11. Suppose Your Zend Engine Supports The Mode <? ?> Then How Can U Configure Your Php Zend Engine To Support Mode ?
PHP5 Interview Questions
-
- 12. What Is Meant By Nl2br()?
Inserts HTML line breaks (
) before all newlines in a string string nl2br (string); Returns string with ” inserted before all newlines. For example: echo nl2br(“god blessn you”) will output “god bless
you” to your browser.
- 12. What Is Meant By Nl2br()?
WordPress Tutorial WordPress Interview Questions
Joomla Interview Questions
CakePHP Tutorial
CodeIgniter Interview Questions
PHP7 Tutorial
MYSQL DBA Interview Questions PHP5 Interview Questions WordPress Interview Questions Joomla Interview Questions CakePHP Interview Questions The $fieldName is the name used in the.
All of those are open source resource. Security of Linux is very very more than windows. Apache is a better server that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other scripting language.
AES_ENCRYPT () and AES_DECRYPT ()
One of the main advantages of programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs.
programming is also considered to be better at modeling the real world than is procedural programming. It allows for more complicated and flexible interactions.
systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system
Sometimes a function is best shared among a number of different classes. Such functions can be declared either as member functions of one class or as global functions. In either case they can be set to be friends of other classes, by using a friend specifier in the class that is admitting them. Such functions can use all attributes of the class which names them as a friend, as if they were themselves members of that class.
A friend declaration is essentially a prototype for a member function, but instead of requiring an implementation with the name of that class attached by the double colon syntax, a global function or member function of another class provides the match.
Convert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
$second = date(“s”);
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
$_SESSION[’name’] = “Mizan”;
To know the Image type use exif_imagetype ()
function To know the Image size use getimagesize ()
function To know the image width use imagesx ()
function To know the image height use imagesy() function t
By using $_SERVER[‘HTTP_USER_AGENT’] variable.
By default the maximum size is 2MB. and we can change the following set up a php.iniupload_max_filesize = 2M
by changing the following set up a php.inimax_execution_time = 30 ; Maximum execution time of each script, in seconds
session_id() returns the session id for the current session.
session_unregister — Unregister a global variable from the current session session_unset — Free all session variables
Set the cookie in past.
eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.eregi_replace() function is identical to ereg_replace() except that this ignores case distinction when matching alphabetic characters.
Sort(), arsort(), asort(), ksort(), natsort(), natcasesort(), rsort(), usort(), array_multisort(), and uksort().
2 ways
Though i am not sure if this is wrong or not, With the exif extension you are able to work with image meta data.
bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.
Case Studio
Smart Draw
You can maintain two separate language file for each of the language. all the labels are put in both language files as variables and assign those variables in the PHP source. on runtime choose the required language option.
Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract. Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be defined by its implemented class.
JavaScript does not have any networking capabilities as it is designed to work on client site. As a result we can not send mails using JavaScript. But we can call the client side mail protocol mailto via JavaScript to prompt for an email to send. this requires the client to approve it.
The syntex for repairing a MySQL table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended] This command will repair the table specified if the quick is given the MySQL will do a repair of only the index tree if the extended is given it will create index row by row
MySQL set can take zero or more values but at the maximum it can take 64 values
describe Table-Name;
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension.
In MySql, the default table type is MyISAM. Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.
The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension,
Use this for mysql >SELECT COUNT(*) FROM table_name;
$result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo “$num_rows rows found”;
SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use
SELECT CURTIME();
CURRENT_TIME() = CURTIME()
In PHP an extended class is always dependent on a single base class, that is, multiple inheritance is not supported. Classes are extended using the keyword ‘extends’.
Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP.
ORDER BY [col1],[col2],…,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.GROUP BY [col1],[col2],…,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if you want to count all items in group, sum all values or view average.
Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes
Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes
eg. name char(15) will waste 10 bytes if we store ‘mizan’, if each char takes a byte
eg. name varchar(15) will just use 5 bytes if we store ‘mizan’, if each char takes a byte.
rest 10 bytes will be free.
Calculate the md5 hash of a string. The hash is a 32-character hexadecimal number. I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using.
you can use LOAD DATA INFILE file_name; syntax to load data from a text file. but you have to make sure that
SELECT DATEDIFF(’2007-03-07′,’2005-01-01′);
$date1 = date(‘Y-m-d’);
$date2 = ’2006-08-15′;
$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);
The float property sets where an image or a text will appear in another element.
A namespace is a container and allows you to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you’ve attached all further methods, properties and objects. But it is not always necessary to use namespace.
$_GET[] and $_REQUEST[]
When PHP is used on a Web server to handle a HTTP request, it converts information submitted in the HTTP request as predefined variables:
There are many ways to accomplish the security tasks but the most common 7 ways are
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install “packages”
A persistent cookie is a cookie which is stored in a cookie file permanently on the browser’s computer. By default, cookies are created as temporary cookies which stored only in the browser’s memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
What does a special set of tags do in PHP? The output is displayed directly to the browser.
Via define() directive, like define (”MYCONSTANT”, 100);
require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.
But require() and include() will do it as many times they are asked to do.
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits.
For example: urlencode(”10.00%”) will return “10%2E00%25″. URL encoded strings are safe to be used as part of URLs. urldecode() returns the URL decoded version of the given string.
Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like “{$a},000,000 mln dollars”, then you definitely need to use the braces.
You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD(”Password”);
Just like in C++, put an ampersand in front of it, like $a = &$b
string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive.
stristr() is identical to strstr() except that it is case insensitive.
When the original if was followed by : and then the code block without braces.
strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example: strstr(”user@example.com”,”@”) will return “@example.com”.
stristr() is idential to strstr() except that it is case insensitive.
func_num_args() function returns the number of parameters passed in.
In MySQL, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,
5, it’s a reference to existing variable.
Everything is passed by value.
DROP TABLE table_name – This will delete the table and its data.
TRUNCATE TABLE table_name – This will delete the data of the table, but not the table definition.
When we submit a form, which has the GET method it displays pair of name/value used in the form at the address bar of the browser preceded by url. Post method doesn’t display these values.
Here are three basic types of runtime errors in PHP:
- Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.
- Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
- Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.
Internally, these variations are represented by twelve different error types
-
- 82. What’s The Special Meaning Of __sleep And __wakeup?
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
- 82. What’s The Special Meaning Of __sleep And __wakeup?
-
- 83. Why Doesn’t The Following Code Print The Newline Properly?
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters – and n.
- 83. Why Doesn’t The Following Code Print The Newline Properly?
-
- 84. Would You Initialize Your Strings With Single Quotes Or Double Quotes?
Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
- 84. Would You Initialize Your Strings With Single Quotes Or Double Quotes?
-
- 85. What Is The Difference Between Characters 23 And x23?
The first one is octal 23, the second is hex 23.
- 85. What Is The Difference Between Characters 23 And x23?
-
- 86. How Can We Submit Form Without A Submit Button?
We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form.
For example:
- 86. How Can We Submit Form Without A Submit Button?
-
- 87. How Many Ways We Can Retrieve The Date In Result Set Of Mysql Using Php?
As individual objects so single record or as a set or arrays.
- 87. How Many Ways We Can Retrieve The Date In Result Set Of Mysql Using Php?
-
- 88. What’s The Output Of The Ucwords Function In This Example?
$formatted = ucwords(”FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS”);
print $formatted;
What will be printed is FYICENTER IS COLLECTION OF INTERVIEW QUESTIONS.
ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first.
- 88. What’s The Output Of The Ucwords Function In This Example?
-
- 89. What’s The Difference Between Htmlentities() And Htmlspecialchars()?
htmlspecialchars only takes care of <, >, single quote ‘, double quote ” and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.
- 89. What’s The Difference Between Htmlentities() And Htmlspecialchars()?
-
- 90. How Can We Extract String “ap6am.com” From A String “mailto:info@ap6am.com?subject=feedback” Using Regular Expression Of Php?
$text = “mailto:info@ap6am.com?subject=Feedback”; preg_match(’|.*@([^?]*)|’, $text, $output); echo $output[1];
Note that the second index of $output, $output[1], gives the match, not the first one, $output[0].
- 90. How Can We Extract String “ap6am.com” From A String “mailto:info@ap6am.com?subject=feedback” Using Regular Expression Of Php?
-
- 91. So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()?
Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.
- 91. So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()?
-
- 92. What Is The Maximum Length Of A Table Name, A Database Name, Or A Field Name In Mysql?
Database name: 64 characters
Table name: 64 characters
Column name: 64 characters
- 92. What Is The Maximum Length Of A Table Name, A Database Name, Or A Field Name In Mysql?
-
- 93. What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command?
DESCRIBE table_name;
- 93. What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command?
-
- 94. What’s The Difference Between Md5(), Crc32() And Sha1() Crypto On Php?
The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.
- 94. What’s The Difference Between Md5(), Crc32() And Sha1() Crypto On Php?
-
- 95. Give The Syntax Of Grant Commands?
The generic syntax for GRANT is as following
GRANT [rights] on [database] TO [username@hostname] IDENTIFIED BY [password]
Now rights can be:- ALL privileges
- Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We can grant rights on all databse by using *.* or some specific database by database.* or a specific table by database.table_name.
- 95. Give The Syntax Of Grant Commands?
-
- 96. Will Comparison Of String “10” And Integer 11 Work In Php?
Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
- 96. Will Comparison Of String “10” And Integer 11 Work In Php?
-
- 97. How Can We Change The Name Of A Column Of A Table?
This will change the name of column:
ALTER TABLE table_name CHANGE old_colm_name new_colm_name
- 97. How Can We Change The Name Of A Column Of A Table?
-
- 98. How Can We Change The Data Type Of A Column Of A Table?
This will change the data type of a column:
ALTER TABLE table_name CHANGE colm_name same_colm_name [new data type]
- 98. How Can We Change The Data Type Of A Column Of A Table?
-
- 99. How Can We Know That A Session Is Started Or Not?
A session starts by session_start() function.
This session_start() is always declared in header portion. it always declares first. then we write session_register().
- 99. How Can We Know That A Session Is Started Or Not?
-
- 100. What Are The Differences Between Mysql_fetch_array(), Mysql_fetch_object(), Mysql_fetch_row()?
mysql_fetch_array() -> Fetch a result row as a combination of associative array and regular array.
mysql_fetch_object() -> Fetch a result row as an object.
mysql_fetch_row() -> Fetch a result set as a regular array().
- 100. What Are The Differences Between Mysql_fetch_array(), Mysql_fetch_object(), Mysql_fetch_row()?
-
- 101. If We Login More Than One Browser Windows At The Same Time With Same User And After That We Close One Window, Then Is The Session Is Exist To Other Windows Or Not? And If Yes Then Why? If No Then Why?
Session depends on browser. If browser is closed then session is lost. The session data will be deleted after session time out. If connection is lost and you recreate connection, then session will continue in the browser.
- 101. If We Login More Than One Browser Windows At The Same Time With Same User And After That We Close One Window, Then Is The Session Is Exist To Other Windows Or Not? And If Yes Then Why? If No Then Why?
-
- 102. What Are The Mysql Database Files Stored In System ?
Data is stored in name.myd
Table structure is stored in name.frm
Index is stored in name.myi
- 102. What Are The Mysql Database Files Stored In System ?
-
- 103. What Is The Difference Between Php4 And Php5?
PHP4 cannot support oops concepts and Zend engine 1 is used.
PHP5 supports oops concepts and Zend engine 2 is used.
Error supporting is increased in PHP5.
XML and SQLLite will is increased in PHP5.
- 103. What Is The Difference Between Php4 And Php5?
-
- 104. Can We Use Include(abc.php) Two Times In A Php Page Makeit.php?
Yes we can include that many times we want, but here are some things to make sure of:
(including abc.PHP, the file names are case-sensitive) there shouldn’t be any duplicate function names, means there should not be functions or classes or variables with the same name in abc.PHP and makeit.php.
- 104. Can We Use Include(abc.php) Two Times In A Php Page Makeit.php?
-
- 105. How Can We Encrypt And Decrypt A Data Presented In A Table Using Mysql?
You can use functions: AES_ENCRYPT() and AES_DECRYPT() like:
AES_ENCRYPT(str, key_str)
AES_DECRYPT(crypt_str, key_str)
- 105. How Can We Encrypt And Decrypt A Data Presented In A Table Using Mysql?
-
- 106. How Can I Retrieve Values From One Database Server And Store Them In Other Database Server Using Php?
For this purpose, you can first read the data from one server into session variables. Then connect to other server and simply insert the data into the database.
- 106. How Can I Retrieve Values From One Database Server And Store Them In Other Database Server Using Php?
-
- 107. Who Is The Father Of Php And What Is The Current Version Of Php And Mysql?
Rasmus Lerdorf.
PHP 5.1. Beta
MySQL 5.0
- 107. Who Is The Father Of Php And What Is The Current Version Of Php And Mysql?
-
- 108. In How Many Ways We Can Retrieve Data In The Result Set Of Mysql Using Php?
mysql_fetch_array – Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc – Fetch a result row as an associative array
mysql_fetch_object – Fetch a result row as an object
mysql_fetch_row —- Get a result row as an enumerated array
- 108. In How Many Ways We Can Retrieve Data In The Result Set Of Mysql Using Php?
-
- 109. What Are The Functions For Imap?
imap_body
– Read the message body
imap_check
– Check current mailbox
imap_delete
– Mark a message for deletion from current mailbox
imap_mail
– Send an email message
- 109. What Are The Functions For Imap?
-
- 110. What Are Encryption Functions In Php?
CRYPT()
MD5()
- 110. What Are Encryption Functions In Php?
-
- 111. What Is The Difference Between Htmlentities() And Htmlspecialchars()?
htmlspecialchars()
– Convert some special characters to HTML entities (Only the most widely used)
htmlentities()
– Convert ALL special characters to HTML entities
- 111. What Is The Difference Between Htmlentities() And Htmlspecialchars()?
-
- 112. How To Set Cookies?
setcookie(’variable’,’value’,’time’);
variable – name of the cookie variable
value – value of the cookie variable
time – expiry time
Example: setcookie(’Test’,$i,time()+3600);
Test – cookie variable name
$i – value of the variable ‘Test’
time()+3600 – denotes that the cookie will expire after an one hour
- 112. How To Set Cookies?
-
- 113. How To Reset/destroy A Cookie?
Reset a cookie by specifying expire time in the past:
Example: setcookie(’Test’,$i,time()-3600); // already expired time
Reset a cookie by specifying its name only Example: setcookie(’Test’);
- 113. How To Reset/destroy A Cookie?
-
- 114. Tools Used For Drawing Er Diagrams.
Case Studio
Smart Draw
- 114. Tools Used For Drawing Er Diagrams.
-
- 115. How Can We Submit From Without A Submit Button?
Trigger the JavaScript code on any event ( like onSelect of dropdown listbox, onfocus, etc )
document.myform.submit(); This will submit the form.
- 115. How Can We Submit From Without A Submit Button?
-
- 116. What Are The Current Versions Of Apache, Php, And Mysql?
PHP: PHP 5.1.2
MySQL: MySQL 5.1
Apache: Apache 2.1
- 116. What Are The Current Versions Of Apache, Php, And Mysql?
-
- 117. What Are The Features And Advantages Of Object Oriented Programming?
One of the main advantages of programming is its ease of modification; objects can easily be modified and added to a system there by reducing maintenance costs.
programming is also considered to be better at modeling the real world that is procedural programming. It allows for more complicated and flexible interactions.
systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. For some systems, an approach can speed development time since many objects are standard across systems and can be reused. Components that manage dates, shipping, shopping carts, etc. can be purchased and easily modified for a specific system.
- 117. What Are The Features And Advantages Of Object Oriented Programming?
-
- 118. How Can I Make A Script That Can Be Bilingual (supports English, German)?
You can change charset variable in above line in the script to support bi-language.
- 118. How Can I Make A Script That Can Be Bilingual (supports English, German)?
-
- 119. What’s The Difference Between Accessing A Class Method Via -> And Via ::?
:: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.
- 119. What’s The Difference Between Accessing A Class Method Via -> And Via ::?
-
- 120. How Can Increase The Performance Of Mysql Select Query?
We can use LIMIT to stop MySql for further search in table after we have received our required no. of records, also we can use LEFT JOIN or RIGHT JOIN instead of full join in cases we have related data in two or more tables.
- 120. How Can Increase The Performance Of Mysql Select Query?
-
- 121. When You Want To Show Some Part Of A Text Displayed On An Html Page In Red Font Color? What Different Possibilities Are There To Do This? What Are The Advantages /disadvantages Of These Methods?
There are 2 ways to show some part of a text in red:- Using HTML tag
- Using HTML tag
- 121. When You Want To Show Some Part Of A Text Displayed On An Html Page In Red Font Color? What Different Possibilities Are There To Do This? What Are The Advantages /disadvantages Of These Methods?
-
- 122. What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?
There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.
- 122. What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages?
-
- 123. Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag.
Try this: /href=”([^”]*)”/i
- 123. Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag.
-
- 124. How Many Ways We Can Give The Output To A Browser?
HTML output
PHP, ASP, JSP, Servlet Function
Script Language output Function
Different Type of embedded Package to output to a browser
- 124. How Many Ways We Can Give The Output To A Browser?
-
- 125. What Is The Default Session Time In Php And How Can I Change It?
The default session time in php is until closing of browser
- 125. What Is The Default Session Time In Php And How Can I Change It?
-
- 126. What Changes I Have To Do In Php.ini File For File Uploading?
Make the following line uncomment like:
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not specified).
upload_tmp_dir = C:apache2triadtemp
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
- 126. What Changes I Have To Do In Php.ini File For File Uploading?
-
- 127. Steps For The Payment Gateway Processing?
An online payment gateway is the interface between your merchant account and your Web site. The online payment gateway allows you to immediately verify credit card transactions and authorize funds on a customer’s credit card directly from your Web site. It then passes the transaction off to your merchant bank for processing, commonly referred to as transaction batching
- 127. Steps For The Payment Gateway Processing?
-
- 128. How Many Ways I Can Redirect A Php Page?
Here are the possible ways of php page redirection.- Using Java script:
‘; echo ‘window.location.href=”‘.$filename.’”;’; echo ”; echo ”; echo ”; echo ”; } } redirect(’https://interviewquestions.ap6am.com’); ?> - Using php function: header(”Location:https://interviewquestions.ap6am.com “);
- Using Java script:
- 128. How Many Ways I Can Redirect A Php Page?
-
- 129. List Out Different Arguments In Php Header Function?
void header ( string string [, bool replace [, int http _ response _ code]])
- 129. List Out Different Arguments In Php Header Function?
-
- 130. What Type Of Headers Have To Be Added In The Mail Function To Attach A File?
$boundary = ‘–’ .md5(uniqid(rand())); $headers = “From: ”Me”n”; $headers .= “MIME-Version: 1.0n”; $headers .= “Content-Type: multipart/mixed; boundary=”$boundary””;
- 130. What Type Of Headers Have To Be Added In The Mail Function To Attach A File?
-
- 131. What Is The Difference Between Reply-to And Return-path In The Headers Of A Mail Function?
Reply-to:
Reply-to is where to delivery the reply of the mail.
Return-path:
Return path is when there is a mail delivery failure occurs then where to delivery the failure notification.
- 131. What Is The Difference Between Reply-to And Return-path In The Headers Of A Mail Function?
-
- 132. How To Turn On The Session Support?
The session support can be turned on automatically at the site level, or manually in each PHP page script:- Turning on session support automatically at the site level: Set session.auto_start = 1 in php.ini.
- Turning on session support manually in each page script: Call session_start() function.
- 132. How To Turn On The Session Support?
-
- 133. Explain The Ternary Conditional Operator In Php?
Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
- 133. Explain The Ternary Conditional Operator In Php?
-
- 134. What’s The Difference Between Include And Require?
It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
- 134. What’s The Difference Between Include And Require?
-
- 135. How To Read The Entire File Into A Single String?
If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them in a single string. Here is a PHP script example on how to file_get_contents():
$file = file_get_contents(”/windows/system32/drivers/etc/services”);
print(”Size of the file: “.strlen($file).”n”);
?>
This script will print:
Size of the file: 7116
- 135. How To Read The Entire File Into A Single String?