Header menu

_________________________________________________________________________________
Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Tuesday, 20 May 2014

In how ways you can add css to a html page ?


 

Methods to add css to html page :

We can add css to a page using 3 methods :

a) External css
b) Internal css 
c) Inline css 

External css : In this we make an css file and then call that file in our page using link .
      

Internal css : In this we write our css in head of the the html page using style tag.
               

Inline css : In this we add style to the element . 

The best method of adding css is external and the most powerful is inline because override    previous css included.

Sunday, 19 January 2014

Best collection of php interview questions with answer for freshers


ANY SUGGESTION , QUESTION or CORRECTION is heartly welcome ... 


Ques 1. How can I disable the output of error message inside a HTML page?

Ans. Use  error_reporting(0);  to hide the error message in output.


Ques.2 Can we return other file formats (like Word, Excel, etc) using PHP script?

Ans. Yes we can create and return file formats(like Word, Excel etc) using php script.


Ques.3 Why we use session variable ?

Ans.  When we work on an application, we open it, do our stuff and then we close it. This is much like a (time interval)Session. The computer knows who we are. It knows when we started the application and when we ended it. But on the internet there is a problem,  web server does not know who we are and what we do. Because the HTTP address does not maintain state.
A PHP session solves this problem by allowing us to store user information on the server for later use (i.e. username, place,email id etc). However, session information is temporary and will be deleted as soon as the user has left the website. If we need a permanent storage then we have to store the data in a database.


Ques.4 Explain PEAR in php ?

Friday, 17 January 2014

Difference between various types of join in SQL


Assuming you're joining on columns with no duplicates, this the most common case:
  • An inner join of table One and Two gives the result of One intersect Two, i.e. the inner part of a venn diagram intersection.
  • An outer join of One and Two gives the results of One union Two, i.e. the outer parts of a venn diagram union.

Examples
Suppose you have two Tables, with a single column each, and data as follows:
One     Two
-     -
1     3
2     4
3     5
4     6

Note that (1,2) are unique to One, (3,4) are common, and (5,6) are unique to Two.


Inner join
An inner join using either of the equivalent queries gives the intersection of the two tables, i.e. the two rows they have in common.
select * from One INNER JOIN Two on One.One = Two.Two;


One  | Two

3  | 3
4  | 4

Wednesday, 15 January 2014

Explain difference between include , require and require_once in php ?


To include the content of a PHP file into another PHP file before the server executes it. There are three PHP functions which can be used to include one PHP file into another PHP file.
  • The include() Function 
  • The require() Function
  • The require_once() Function
These functions helps in creating functions, headers, footers, or elements that can be reused on multiple pages. This help developers to change the layout of complete website with minimal effort. If there is any change needed then instead of making change in large numbers of files just change included file.

The include() Function

The include() function copies all text from file which is passed as parameter into the file that uses the include function. If there is any problem in loading thefile then the include() function generates a warning but the script will continue execution.

Thursday, 19 December 2013

Explain difference between array_merge( ) and array_combine( ) in php

ARRAY_MERGE()


array_merge() id used to merge the elements of one or more than one array in such a way  that the value of one array appends at the end of first array. If the any of the arrays have same key ,then the later value overrides the previous value for that key. The output of the function is one resultant array and this function takes two arrays as input.

ARRAY_COMBINE()


array_combine() is used to creates a new array by using the key of one array as keys and using the value of other array as values.One thing to keep in mind while using array_combine() that number of values in both arrays must be same.

Example :

<h2>ARRAY_MERGE()</h2>
<?php
$array1 = array("one" => "java","two" => "sql");

Wednesday, 18 December 2013

Explain Header() function in php in detail

Header function in php :



<?php header("Location: http://www.codesplanet.blogspot.com/"); ?>

Header function in php is used for redirection to some other page. In simplest form it takes one parameter
the destination url . 

Uses of header() function in php

 

1. The header() function use to sends a raw HTTP header to a client.
2. Use for refresh the page on after given time interval.
3. can be used to send email header content like cc, bcc , reply to etc data and lot more .


What is the Limitation of HEADER()?


In PHP the one and most horrible limitation of HEADER() function is that