Subscribe For Free Updates!

We'll not spam mate! We promise.

Monday, 17 February 2014

PHP Interview Questions

PHP Interview Questions



PHP Interview Questions

In this article on PHP Interview Questions, I have compiled a list of very basic & fundamental PHP interview questions & answers for web developers. Every PHP web developer should know these basic questions of PHP. So, if you are preparing for any interview in PHP development, you should go through the following list of PHP basic interview questions. There PHP questions are based on very simple PHP concepts like basic introduction to PHP, Sessions & Cookies in PHP, Input / Output in PHP, Error Management in PHP, MySQL database connectivity in PHP, SQL Injection in PHP, Encryption & Decryption in PHP, Sending Emails in PHP, datatypes in PHP & many more. Lets have a look…

1. What is PHP?

PHP is a server side scripting object oriented language commonly used for web applications.

2. What is the use of “echo” in php?

It is used to print a data in the webpage.

Example:

<?php echo ‘Hi’; ?>

The above code print the text in the webpage

3. How to include a file to a php page?

We can include a file using “include()” or “require()” function with file path as its parameter.

4. What’s the difference between include & require?

If the file is not found by require(), it will cause a fatal error & halt the execution of the script. If the file is not found by include(), a warning will be issued, yet execution will continue.

5. What is difference between require_once(), require() & include()?

require() includes & evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don’t include the file more times & you will not obtain the “function re-declared” error.

6. Differences between GET & POST methods?
We can send 1024 bytes using GET method yet POST method can transfer large amount of data & POST is the secure method than GET method .

7. How to declare an array in php?

Eg : var $arr = array(‘apple’, ‘grape’, ‘lemon’);

8. What is the use of ‘print’ in php?

This is not actually a real function, It is a language construct. So you can use without parentheses with its argument list.

Example:

print(‘PHP Interview Questions’);
print ‘PHP Interview Questions’;

9. What is use of in_array() function in php?
in_array used to checks if a value exists in an array

10. What is use of count() function in php?

count() is used to count all elements in an array, or something in an object

11. What is the difference between Session & Cookie?
The main difference between sessions & cookies is that sessions are stored on the server, & cookies are stored on the user’s computers in the text file format. Cookies can not hold multiple variables, yet Session can hold multiple variables. We can set expiry for a cookie while the session only remains active as long as the browser is open. Users do not have access to the data you stored in Session because it is stored in the server. Session is mainly used for login/logout purpose while cookies using for user activity tracking

12. How to set cookies in PHP?

Setcookie(“sample”, “ram”, time()+3600);

13. How to retrieve a Cookie Value?
eg : echo $_COOKIE["user"];

14. How to create a session? How to set a value in session ? How to remove data from a session?
Create session : session_start();
Set value into session : $_SESSION['USER_ID']=1;
Remove data from a session : unset($_SESSION['USER_ID'];

15. What types of loops exist in php?

for,while,do while & foreach

16. How to create a mysql connection?

mysql_connect(servername,username,password);

17. How to select a database?

mysql_select_db($db_name);

18. How to execute an sql query? How to fetch its result ?

$my_qry = mysql_query(“SELECT * FROM `users` WHERE `u_id`=’1′; “);
$result = mysql_fetch_array($my_qry);
echo $result['First_name'];

19. Write a program using while loop

$my_qry = mysql_query(“SELECT * FROM `users` WHERE `u_id`=’1′; “);
while($result = mysql_fetch_array($my_qry))
{
echo $result['First_name'.].”<br/>”;
}

20. How we can retrieve the data in the result set of MySQL using PHP?

1. mysql_fetch_row
2. mysql_fetch_array
3. mysql_fetch_object
4. mysql_fetch_assoc

Sunday, 16 February 2014

Keyboard Shortcuts (Microsoft Windows)

       Microsoft Windows shortcut keys

Microsoft Windows shortcut keys

General Windows keyboard shortcuts


Alt + Tab

Switch between open applications in all versions of Windows. Reverse the direction by pressing Alt + Shift + Tab at the same time.

Ctrl + Tab

Switches between program groups, tabs, or document windows in applications that support this feature. Reverse the direction by pressing Ctrl + Shift + Tab at the same time.

Alt + double-click

Display the properties of the object you double-click on in Windows 95 and later. For example, doing this on a file would display its properties.

Alt + Print Screen

Create a screen shot only for the active program window in all versions of Windows. For example, if you opened the calculator and did this only the calculator window would be created as a screen shot. If just the Print Screen key is pressed the whole screen will be made into a screen shot.

Ctrl + Alt + Del

Open the Windows option screen for locking computer, switching user, Task Manager, etc. in later versions of Windows. Pressing Ctrl+Alt+Del multiple times will reboot the computer.

Ctrl + Shift + Esc

Immediately bring up the Windows Task Manager in Windows 2000 and later.

Ctrl + Esc

Open the Windows Start menu in most versions of Windows. In Windows 8 this will open the Start screen and in Windows 3.x this would bring up the Task Manager.

Alt + Esc

Switch between open applications on Taskbar in Windows 95 and later.

Alt + Space bar

Drops down the window control menu for the currently open Windows program in Windows 95 and later.

Alt + Enter

Opens properties window of selected icon or program in Windows 95 and later.

Shift + Del

Will delete any file or other object without throwing it into the Recycle Bin in Windows 95 and later.

Hold down the Shift key

When putting in an audio CD or other CD that uses Autoplay, holding down the Shift key will prevent that CD from playing.

Windows function key shortcuts

Below is a listing of keyboard shortcuts that use the keyboard function keys. See our what are F1 through F12 keys page for a full listing of what function keys do with all other programs.

F1

Activates help for current open application. If you're at the Windows Desktop, this will activate the help for Windows.

F2

Renames a highlighted icon, file, or folder in all versions of Windows.

F3

Starts find or search when at the Windows Desktop in all versions of Windows.

F4

In Windows 95 and later this opens the drive selection or address bar when browsing files in Windows Explorer.

Pressing Alt + F4 closes the current open program window without a prompt in all versions of Windows.
Pressing Ctrl + F4 closes the open window within the current active window in Microsoft Windows. This will only work in programs that support multiple windows or tabs in the same program window.

F6

While in Windows Explorer, this will move the cursor to different Windows Explorer pane or in Windows 7 browse available drives.

F8

Pressing F8 over and over as the computer is booting will start the computer in Safe Mode.

F10

Activates the File menu bar in all versions of Windows.

Simulates a right-click on selected item. This is useful if right-click is difficult or impossible using the mouse.

Windows keyboard key shortcuts


Below is a listing of Windows keys that can be used on computers running a Microsoft Windows 95 or later and using a keyboard with a Windows key. In the below list of shortcuts, the Windows key is represented by "WINKEY" and because not all these shortcuts will work in all versions of Windows we've mentioned what versions of Windows support each Windows key shortcut key.

All versions of Windows


WINKEY

Pressing the Windows key alone will open or hide the Windows Start menu. In Windows 8, this will open or hide the Start screen.

WINKEY + F1

Open the Microsoft Windows help and support center.

WINKEY + Pause / Break key

Open the System Properties window.

WINKEY + D

Opens the Desktop to the top of all other windows.

WINKEY + E

Open Microsoft Windows Explorer.

WINKEY + F
Display the Windows Search or Find feature.

WINKEY + Ctrl + F

Display the search for computers window.

WINKEY + L

Lock the computer and switch users if needed (Windows XP and above only).

WINKEY + M

Minimizes all windows.

WINKEY + Shift + M

Undo the minimize done by WINKEY + M and WINKEY + D.

WINKEY + R

Open the run window.

WINKEY + U

Open Utility Manager or the Ease of Access Center.

Windows XP only
Windows 7 and 8 only
Windows 8 only

Windows XP only


WINKEY + Tab

Cycle through open programs through the Taskbar.

Windows 7 and 8 only


WINKEY + 1-0

Pressing the Windows key and any of the top row number keys from 1 to 0 will open the program corresponding to the number of icon on the Taskbar. For example, if the first icon on the Taskbar was Internet Explorer pressing WINKEY + 1 would open that program or switch to it if already open.

WINKEY + (Plus (+) or Minus (-))

Open Windows Magnifier and zoom in with the plus symbol (+) and zoom out with the minus symbol (-).

Press the WINKEY + ESC to close the Magnifier

WINKEY + Home

Minimize all windows except the active window.

WINKEY + P

Change between the monitor and projection display types or how second screen displays computer screen.

WINKEY + T

Set the focus on the Taskbar icons

WINKEY + Left arrow

Shrinks the window to 1/2 screen on the left side for side by side viewing.

WINKEY + Right arrow

Shrinks the window to 1/2 screen on the right side for side by side viewing.

WINKEY + Up arrow
When in the side by side viewing mode, this shortcut takes the screen back to full size.

WINKEY + Down arrow

Minimizes the screen. Also, when in the side by side viewing mode, this shortcut takes the screen back to a minimized size.

Windows 8 only


WINKEY + ,

Peek at the Windows Desktop.

WINKEY + .

Snap a Windows App to the sides of the screen. Pressing it multiple times will switch between the right and left-hand side of the screen or unsnap the app.

WINKEY + Enter

Open Windows Narrator

WINKEY + C

Open the Charms.

WINKEY + G

Cycle through Desktop gadgets.

WINKEY + H
Open Share in Charms.

WINKEY + I

Open the Settings in Charms.

WINKEY + J

Switch between snapped apps.

WINKEY + K

Open Devices in Charms.

WINKEY + O

Lock the screen orientation.

WINKEY + X
Open the power user menu, which gives you access to many of the features most power users would want to use such as Device Manager, Control Panel, Event Viewer, Command Prompt, and much more.

Wednesday, 5 February 2014

download and install jdk on windows 7


In this video we are start learn java online course. I demonstrate how to set up java in your computer. This is a fairly simple procedure as the video explains. This video is in Hindi and it is aimed at those who struggle to understand English.There are several links that I refer to and they are as follows: To get JDK and JRE visit: JDK download link To get Notepad++ visit :Notepad++ download link I hope that the content of the video was good enough to help you learn how to install Java on your computer.