InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 151. |
What Are The Different Ways To Login To A Remote Server? Explain The Means, Advantages And Disadvantages? |
|
Answer» There is at LEAST 3 ways to logon to a REMOTE server: There is at least 3 ways to logon to a remote server: |
|
| 152. |
Give The Syntax Of Grant Commands? |
|
Answer» The generic syntax for GRANT is as following Now rights can be: We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name. The generic syntax for GRANT is as following Now rights can be: We can grant rights on all databse by usingh *.* or some specific database by database.* or a specific table by database.table_name. |
|
| 153. |
Please Give A Regular Expression (preferably Perl/preg Style), Which Can Be Used To Identify The Url From Within A Html Link Tag? |
|
Answer» Try this: /href="([^"]*)"/i. |
|
| 154. |
How Many Ways We Can Give The Output To A Browser? |
|
Answer» HTML output HTML output |
|
| 155. |
How Many Ways We Can We Find The Current Date Using Mysql? |
|
Answer» SELECT CURDATE(); SELECT CURDATE(); |
|
| 156. |
What Is The Default Session Time In Php And How Can I Change It? |
|
Answer» The DEFAULT SESSION TIME in php is until CLOSING of BROWSER. The default session time in php is until closing of browser. |
|
| 157. |
How Can We Find The Number Of Rows In A Result Set Using Php? |
|
Answer» Here is how can you find the NUMBER of rows in a RESULT set in PHP: $result = mysql_query($any_valid_sql, $database_link); Here is how can you find the number of rows in a result set in PHP: $result = mysql_query($any_valid_sql, $database_link); |
|
| 158. |
What's The Difference Between Md5(), Crc32() And Sha1() Crypto On Php? |
|
Answer» 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. 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. |
|
| 159. |
What Changes I Have To Do In Php.ini File For File Uploading? |
|
Answer» Make the following line uncomment like: Make the following line uncomment like: |
|
| 160. |
How Can We Find The Number Of Rows In A Table Using Mysql? |
|
Answer» USE this for MYSQL Use this for MySQL |
|
| 161. |
What Are The Other Commands To Know The Structure Of A Table Using Mysql Commands Except Explain Command? |
|
Answer» DESCRIBE table_name; DESCRIBE table_name; |
|
| 162. |
How Many Values Can The Set Function Of Mysql Take? |
|
Answer» MySQL SET FUNCTION can TAKE zero or more VALUES, but at the maximum it can take 64 values. MySQL SET function can take zero or more values, but at the maximum it can take 64 values. |
|
| 163. |
What Is The Maximum Length Of A Table Name, A Database Name, Or A Field Name In Mysql? |
|
Answer» DATABASE NAME: 64 CHARACTERS Database name: 64 characters |
|
| 164. |
How Many Ways We Can Pass The Variable Through The Navigation Between The Pages? |
|
Answer» At least 3 ways: At least 3 ways: |
|
| 165. |
How Many Ways I Can Redirect A Php Page? |
|
Answer» Here are the POSSIBLE ways of php page redirection. 1. Using Java script:
Here are the possible ways of php page redirection. 1. Using Java script: 2. Using php function: header
|
|
| 166. |
How Can We Know The Count / Number Of Elements Of An Array? |
|
Answer»
sizeof($array) - This function is an alias of count(). 2 ways: sizeof($array) - This function is an alias of count(). |
|
| 167. |
What Are The Different Functions In Sorting An Array? |
|
Answer» SORTING functions in PHP: Sorting functions in PHP: |
|
| 168. |
List Out Different Arguments In Php Header Function? |
|
Answer» void header ( STRING string [, bool REPLACE [, int http_response_code]]). void header ( string string [, bool replace [, int http_response_code]]). |
|
| 169. |
What Type Of Headers Have To Be Added In The Mail Function To Attach A File? |
|
Answer» $BOUNDARY = '--' . MD5( uniqid ( RAND() ) ); $boundary = '--' . md5( uniqid ( rand() ) ); |
|
| 170. |
How Can We Destroy The Session, How Can We Unset The Variable Of A Session? |
|
Answer» session_unregister() - UNREGISTER a GLOBAL VARIABLE from the current session. session_unset() - FREE all session variables. session_unregister() - Unregister a global variable from the current session. session_unset() - Free all session variables. |
|
| 171. |
So If Md5() Generates The Most Secure Hash, Why Would You Ever Use The Less Secure Crc32() And Sha1()? |
|
Answer» 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. 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. |
|
| 172. |
What Is The Difference Between Reply-to And Return-path In The Headers Of A Mail Function? |
|
Answer» 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. 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. |
|
| 173. |
How To Store The Uploaded File To The Final Location? |
|
Answer» move_uploaded_file ( string FILENAME, string destination) This function checks to ensure that the file designated by filename is a valid upload file (MEANING that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination. If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will RETURN FALSE. If filename is a valid upload file, but cannot be moved for some REASON, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued. move_uploaded_file ( string filename, string destination) This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination. If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE. If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued. |
|
| 174. |
What's The Difference Between Htmlentities() And Htmlspecialchars()? |
|
Answer» htmlspecialchars only takes care of <, >, SINGLE quote ‘, double quote " and ampersand. htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand. |
|
| 175. |
Explain The Ternary Conditional Operator In Php? |
|
Answer» Expression PRECEDING the ? is evaluated, if it’s TRUE, then the expression preceding the : is EXECUTED, OTHERWISE, the expression following : is executed. Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed. |
|
| 176. |
What's The Difference Between Include And Require? |
|
Answer» 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. 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. |
|
| 177. |
Can We Use Include ("abc.php") Two Times In A Php Page "makeit.php"? |
|
Answer» Yes. Yes. |
|
| 178. |
How Many Ways Can We Get The Value Of Current Session Id? |
|
Answer» session_id() RETURNS the SESSION ID for the CURRENT session. session_id() returns the session id for the current session. |
|
| 179. |
How Many Ways We Can Retrieve The Date In Result Set Of Mysql Using Php? |
|
Answer» As individual objects so SINGLE RECORD or as a SET or arrays. As individual objects so single record or as a set or arrays. |
|
| 180. |
How Can We Create A Database Using Php And Mysql? |
|
Answer» We can CREATE MYSQL DATABASE with the USE of mysql_create_db($DATABASENAME) to create a database. We can create MySQL database with the use of mysql_create_db($databaseName) to create a database. |
|
| 181. |
How Can We Submit Form Without A Submit Button? |
|
Answer» 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: <input type=button VALUE="Save" onClick="document.form.submit()">. 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: <input type=button value="Save" onClick="document.form.submit()">. |
|
| 182. |
What Is The Difference Between Characters \023 And \x23? |
|
Answer» The FIRST ONE is OCTAL 23, the second is hex 23. The first one is octal 23, the second is hex 23. |
|
| 183. |
How Can We Register The Variables Into A Session? |
|
Answer» session_register($session_var); session_register($session_var); |
|
| 184. |
How Come The Code Works, But Doesn't For Two-dimensional Array Of Mine? |
|
Answer» Any time you have an array with more than ONE dimension, complex PARSING syntax is required. print "CONTENTS: {$arr[1][2]}" WOULD’ve worked. Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked. |
|
| 185. |
Would You Initialize Your Strings With Single Quotes Or Double Quotes? |
|
Answer» 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. 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. |
|
| 186. |
How Can We Submit A Form Without A Submit Button? |
|
Answer» If you don't want to use the Submit BUTTON to submit a FORM, you can use normal hyper LINKS to submit a form. But you need to use some JAVASCRIPT code in the URL of the link. For example: If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. For example: |
|
| 187. |
What's The Special Meaning Of __sleep And __wakeup? |
|
Answer» __sleep RETURNS the array of all the variables than need to be saved, while __wakeup RETRIEVES them. __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them. |
|
| 188. |
What Are The Different Types Of Errors In Php? |
|
Answer» Here are three basic TYPES of runtime errors in PHP:
Internally, these variations are represented by TWELVE different error types. Here are three basic types of runtime errors in PHP: Internally, these variations are represented by twelve different error types. |
|
| 189. |
How Do You Call A Constructor For A Parent Class? |
|
Answer» PARENT::CONSTRUCTOR($VALUE). parent::constructor($value). |
|
| 190. |
What Are The Differences Between Get And Post Methods In Form Submitting, Give The Case Where We Can Use Get And We Can Use Post Methods? |
|
Answer» When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for LONG data sending, SAY more then 100 character you can use POST method. Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information. When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for long data sending, say more then 100 character you can use POST method. Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information. |
|
| 191. |
What Are The Differences Between Drop A Table And Truncate A Table? |
|
Answer» 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. 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. |
|
| 192. |
Are Objects Passed By Value Or By Reference? |
|
Answer» EVERYTHING is PASSED by VALUE. Everything is passed by value. |
|
| 193. |
How To Protect Special Characters In Query String? |
|
Answer» If you want to include SPECIAL characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The SCRIPT below shows how to use urlencode(): <?php If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode(): <?php |
|
| 194. |
If The Variable $a Is Equal To 5 And Variable $b Is Equal To Character A, What's The Value Of $$b? |
|
Answer» 5, it’s a REFERENCE to EXISTING VARIABLE. 5, it’s a reference to existing variable. |
|
| 195. |
What Is The Purpose Of The Following Files Having Extensions: Frm, Myd, And Myi? What These Files Contain? |
|
Answer» In MySQL, the DEFAULT table type is MyISAM. The '.frm' file stores the table DEFINITION. In MySQL, the default table type is MyISAM. The '.frm' file stores the table definition. |
|
| 196. |
How Do I Find Out The Number Of Parameters Passed Into Function9? |
|
Answer» func_num_args() FUNCTION RETURNS the NUMBER of PARAMETERS PASSED in. func_num_args() function returns the number of parameters passed in. |
|
| 197. |
What Is The Difference Between Ereg_replace() And Eregi_replace()? |
|
Answer» eregi_replace() FUNCTION is identical to ereg_replace() except that it ignores CASE distinction when MATCHING alphabetic characters. eregi_replace() function is identical to ereg_replace() except that it ignores case distinction when matching alphabetic characters. |
|
| 198. |
What Is The Functionality Of The Function Strstr And Stristr? |
|
Answer» 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". 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". |
|
| 199. |
How Can We Send Mail Using Javascript? |
|
Answer» No. There is no way to send emails directly using JavaScript. No. There is no way to send emails directly using JavaScript. |
|
| 200. |
When Are You Supposed To Use Endif To End The Conditional Statement? |
|
Answer» When the original if was followed by : and then the CODE BLOCK without BRACES. When the original if was followed by : and then the code block without braces. |
|