Friday, 9 November 2012

PHP Interview Questions Part I

Introduction

Here we have a range of common PHP related questions and answers. If you want to know how to do something in PHP but aren't sure how, then just view the questions here and if you can't find the answer, Ask A Question.

FAQ

What is PHP?

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

How to include a file to a php page?

we can include a file using "include() " or "require()" function with as its parameter..

What’s the difference between include and require?

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.

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

require() includes and 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 and you will not get the "function re-declared" error.

How do you define a constant?

Using define() directive, like define ("MYCONSTANT",150)

What Is a Session?

It can be used to store information on the server for future use

How to set cookies in PHP?

Cookies are often used to track user information

Syntax:

Setcookie(name, value, expire, path, domain);

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

Difference between mysql_connect and mysql_pconnect?

There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends.

mysql_connect()provides only for the databasenewconnection
while using mysql_pconnect , the function would first try to
find a (persistent) link that's already open with the same
host, username and password. If one is found, an identifier
for it will be returned instead of opening a new connection...
the connection to the SQL server will not be closed when the
execution of the script ends. Instead, the link will remain
open for future use.

How to create a mysql connection?

mysql_connect(servername,username,password);

How to open a file?

<?php
$file=fopen("welcome.txt","r");
?>

Thursday, 8 November 2012

IBPS :: CWE – RRB Recruitment Results

Click here To View Scores of CWE – RRB Recruitment of Officer Scale-III

Click here To View Scores of CWE – RRB Recruitment of Officer Scale-II (Specialist Officer)

Click here To View Scores of CWE – RRB Recruitment of Officer Scale-II (GBO)

Click here To View Scores of CWE – RRB Recruitment of Officers Scale-I

Click here To View Scores of CWE – RRB Recruitment of Office Assistant

Click here To View Result Status of CWE – RRB Recruitment of Office Assistant

Click here To View Result Status of CWE – RRB Recruitment of Officers

Click here To view Advertisement for Common Written Examination (CWE) - Regional Rural Banks (RRBs)

Wednesday, 7 November 2012

Obama regains the historic contest, tweets “Four more years”

Washington, Nov 7 : Buoyed by a slowly but surely recovering economy and a display of cool leadership during superstorm Sandy, President Barack Obama scored a decisive victory over Republican challenger Mitt Romney after a long, contentious and expensive election battle. The glad tidings for Obama, who was engaged in one of the closest White House races ever, came around 11.15 p.m. Tuesday when major networks gave him 274 electoral votes to take him over the threshold of 270 required to win. By midnight, Obama, who four years ago made history by becoming the first African-American to occupy the world’s most powerful office with a promise of hope and change to a country in the throes of a deep recession, had increased his lead to 290 and counting. Joyful supporters danced and cheered at Obama’s victory party in Chicago as Obama tweeted: “Four more years.” “We’re all in this together. That’s how we campaigned, and that’s who we are. Thank you,” said another tweet from Obama, the 51-year-old son of a Kenyan father and a white American mother. The mood at Romney’s election-night gathering in Boston was sombre as the challenger called the president and came out to make a concession speech shortly before 1 a.m. Addressing a gathering of cheering supporters in Boston, Romney said he wished Obama and his family well. It was a “time of great challenges for America”, Romney said, adding that he prayed that the “president would be successful in guiding our nation”. He also thanked his running mate Paul Ryan. “Besides my wife Ann, Paul is the best choice I ever made,” Romney, 65, said. “She would have made a wonderful first lady,” he added. Romney, who fought a tough fight that went down to the wire, said this was a “critical time” for the nation. We can’t afford partisan bickering, the Republican challenger to the White House told the crowds, many of whom appeared to be listening with tears in their eyes. “I believe in America. I believe in the people of America,” he said. In early results, Obama won his home state of Illinois as well as Romney’s home state of Massachusetts, where Romney was governor from 2003 to 2007, besides Wisconsin, the home of challenger’s running mate Paul Ryan. Apart from the battleground states of Ohio and Iowa, he also easily won traditional Democratic strongholds of California, New York and other populous states such as Michigan and Pennsylvania, where Romney mounted a late but unsuccessful push, the channel said. Exit polls showed Obama received strong support, as expected, from women voters as well as overwhelming support from African Americans and strong backing from Hispanic voters, similar to the coalition that carried him to victory four years earlier. Meanwhile, CNN projected that Democrats will retain their majority in the Senate, ensuring another divided Congress after Republicans earlier were projected to hold their majority in the US House of Representatives. (Arun Kumar can be contacted at arun.kumar@ians.in) Source: IANS

Feet/Inches to Meters Converter & Lbs to Kgs Converter

 <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8" />   <title>Feet/Inches ⇄...