PHP, MySQL, Javascript, CSS and Ajax Interview Questions and Answer Part – 1

1. How can you stop submitting the form while clicking submit button using javascript?

return false;

2. How can we get second of the current time using date function?
$second = date(“s”);

3. In an unordered list what is the default value for “type”


4. How can we get the browser properties using PHP?


5. Describe box model in IE and Firefox?

IE inclues padding, boder in width/height where as firefox doesnt

6. What is the maximum size of a file that can be uploaded using PHP and how can we change this?

By default the maximum size is 2MB.We can change the following setup at php.ini upload_max_filesize = 3M

7. What is the difference between display:none and visibility:hidden in CSS?

display:none – hides an element, and it will not take up any space.
visibility:hidden – hides an element, but it will still take up the same space as before.

8. How can we set and destroy the cookie in php?

setcookie(“$user”, “$uname”, time()+3600);  set the cookie
setcookie(“$user”, “”, time()-3600);  destroy or delete the cookies

9. How many files will be created when we create table, what are they?

three files. They are
The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension.

10. What is the difference between Primary Key and Unique key?

i.Primary Key: table values shd be uniquely identified and primary key value cannot be NULL.
Unique Key: table values shd be uniquely identified and NULL can be a unique key.
ii.There can be only one primary key in the table but there can be more than one unique in the table.


Leave a Reply