PHP, MySQL, Javascript, CSS and Ajax Interview Questions and Answer Part – 2
11. What are default session time and path?
default session time is 1440 seconds or 24 minutes
Default session save path id temporary folder /tmp
12. What will be the text size “Universe” with the below declaration
<div style=”font-size:12px;”>World is<div style=”font-size:0.5em;”>VERY small in <div style=”font-size:100%;”>Universe</div></div></div>
6px
13. How can you find out the number of parameters passed into the php function?
func_num_args() function returns the number of parameters passed in.
14. How can you execute a PHP script using command line? and how can you execute PHP script using linux command in PHP?
>php myScript.php
exec(myScript.php);
15. What is the difference between the functions unlink and unset?
unlink() is a function for file system handling. It will simply delete the file.
unset() is a function for variable management. It will make a variable undefined.
16. Is there anything wrong with this code?
function attachEventsToListItems() {
var oList = document.getElementById(‘myList’);
var aListItems = oList.getElementsByTagName(‘li’);
for(var i = 0; i < aListItems.length; i++) {
var oListItem = aListItems[i];
oListItem.onclick = alert(i);
}
}
oListItem.onclick = function(){ alert(i); }
17. How can you load data from a text file into a table?
LOAD DATA LOCAL INFILE ‘data.txt’ INTO TABLE test FIELDS TERMINATED BY “,” LINES TERMINATED BY “\n”
18. How much will be the space/gap between the below elements?
<div style=”margin:15px;background-color:blue”>Beautiful</div>
<div style=”margin:20px;background-color:grey”>Rose</div>
35px
19. What is the difference between Reply-to and Return-path in the headers of a mail function?
Reply-to is where to delivery the reply of the mail.
Return path is when there is a mail delivery failure occurs then where to delivery the failure notification.
20. What changes you have to do in php.ini file for file uploading?
i.file_uploads = On
ii.upload_tmp_dir = C:\apache2triad\temp
iii.upload_max_filesize = 2M