Is jQuery a W3C standard?What are the functions for IMAP?What Is a Persistent Cookie?So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?How to set the browser timeout ?Explain about type Juggling with an example in php?Explain the capabilities of views module in Drupal.Explain Taxonomy in drupalExplain the concept of Comment in DrupalHow can you include a javascript menu throughout the site in cakephp?How can you make urls search engine friendly while using cakephp?How can we use ajax in cakephp?Can you remember what is the directory structure when you download cakephp?Can you list some database related functions in cakephp?What are the different types of index in mysql?How do you proceed when you have to use cakephp for any application?If you have to validate a registration module for a user, what all can be possible ways? which one is the best?Using cakephp, what all are drawbacks?What are 3 important parts of MVC (MODEL-VIEW-CONTROLLER)?What is a component, helper and why are they used, is there other way we can do same thing, what is better?What is features in cake php?What is habtm?What is meant by MVC (MODEL-VIEW-CONTROLLER)?What is the first file that gets loaded when you run an application using cakephp?What is the first function that gets loaded from a controller?What is the naming convention in cakephp?what is cakephp?what is the name of Cake's database configuration file?Explain MVC Architecture in Php with exampleHow do you proceed when you have to use cakephp for any application?What are hooks in Drupal ?What is a Module in drupal ?Explain the concept of node in drupal.What is XML-RPC?What is the Web service protocol stack?I keep reading about Web services, but I have never actually seen one. Can you show me a real Web service in action?What is a Web service?What does 403 Forbidden mean?What is DNS?What is SSL? How SSL Works ?What is the difference between a web browser and a web server?What is a web server? How Web Servers Work?What is .htaccess? ~ Interview Questions & Answers

Thursday, November 3, 2011

Is jQuery a W3C standard?

No

Tuesday, June 28, 2011

What are the functions for IMAP?

imap_body - Read the message body
imap_check - Check current mailbox
imap_delete - Mark a message for deletion from current mailbox
imap_mail - Send an email message

What Is a Persistent Cookie?

A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
*Temporary cookies can not be used for tracking long-term information.
*Persistent cookies can be used for tracking long-term information.
*Temporary cookies are safer because no programs other than the browser can access them.
*Persistent cookies are less secure because users can open cookie files see the cookie values.

Wednesday, June 8, 2011

So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.

Friday, May 27, 2011

How to set the browser timeout ?

The set_time_limit() function enables the setting the timeout for the browser. The following snippet set the time out for 15 minutes / 900 seconds set_time_limit(900); The default time limit is 30 seconds or max_execution_time value available in php.ini file.

Thursday, May 26, 2011

Explain about type Juggling with an example in php?

PHP does not require (or support) explicit type definition in variable declaration; a variable's type is determined by the context in which that variable is used. That is to say, if you assign a string value to variable $var, $var becomes a string. If you then assign an integer value to $var, it becomes an integer.
An example of PHP's automatic type conversion is the addition operator '+'. If any of the operands is a float, then all operands are evaluated as floats, and the result will be a float. Otherwise, the operands will be interpreted as integers, and the result will also be an integer. Note that this does NOT change the types of the operands themselves; the only change is in how the operands are evaluated.
$foo += 2; // $foo is now an integer (2)
$foo = $foo + 1.3; // $foo is now a float (3.3)
$foo = 5 + "10 Little Piggies"; // $foo is integer (15)
$foo = 5 + "10 Small Pigs"; // $foo is integer (15)
If the last two examples above seem odd, see String conversion to numbers.
If you wish to change the type of a variable, see settype().
If you would like to test any of the examples in this section, you can use the var_dump() function.
Note: The behavior of an automatic conversion to array is currently undefined.
Since PHP (for historical reasons) supports indexing into strings via offsets using the same syntax as array indexing, the example above leads to a problem: should $a become an array with its first element being "f", or should "f" become the first character of the string $a? The current versions of PHP interpret the second assignment as a string offset identification, so $a becomes "f", the result of this automatic conversion however should be considered undefined. PHP 4 introduced the new curly bracket syntax to access characters in string, use this syntax instead of the one presented above:

Wednesday, May 25, 2011

Explain the capabilities of views module in Drupal.

The Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Traditionally, Drupal has hard-coded most of this, particularly in how taxonomy and tracker lists are formatted.
This tool is essentially a smart query builder that, given enough information, can build the proper query, execute it, and display the results. It has four modes, plus a special mode, and provides an impressive amount of functionality from these modes.
Among other things, Views can be used to generate reports, create summaries, and display collections of images and other content.

Saturday, May 14, 2011

Explain Taxonomy in drupal

Drupal has a system for classifying content, which is known as taxonomy and implemented in the core Taxonomy module. You can define your own vocabularies (groups of taxonomy terms), and add terms to each vocabulary. Vocabularies can be flat or hierarchical, can allow single or multiple selection, and can also be "free tagging" (meaning that when creating or editing content, you can add new terms on the fly). Each vocabulary can then be attached to one or more content types, and in this way, nodes on your site can be grouped into categories, tagged, or classified in any way you choose.

Explain the concept of Comment in Drupal

Comments are another type of content you can have on your site (if you have enabled the core Comment module). Each comment is a typically small piece of content that a user submits, attached to a particular node. For example, each piece of discussion attached to a particular forum topic node is a comment.

Thursday, May 12, 2011

How can you include a javascript menu throughout the site in cakephp?

By adding the javascript files in webroot and call them in default views if needed everywhere or just in the related views.

How can you make urls search engine friendly while using cakephp?

It is an automatic task that is done by cakephp.

Monday, May 9, 2011

How can we use ajax in cakephp?

By calling ajax helper and then using it in controller for rendering

Can you remember what is the directory structure when you download cakephp?

* app/
o config/
o controllers/
o models/
o plugins/
o tmp/
o vendors/
o views/
o webroot/
* cake/
o config/
o docs/
o libs/
* vendors/

Can you list some database related functions in cakephp?

find, findAll , findAllBy , findBy , findNeighbours , query

Saturday, May 7, 2011

What are the different types of index in mysql?

The different types of index are UNIQUE, INDEX and FULLTEXT

How do you proceed when you have to use cakephp for any application?

Take the framework either from cake site or if you have changed according to your needs start from there. proceed with basic software engg. concepts as requirement gathering etc

If you have to validate a registration module for a user, what all can be possible ways? which one is the best?

Can be done on submission in controller, or using javascript/ajax while user is still filling the data. second option is better.

Using cakephp, what all are drawbacks?

The learning curve, and it loads full application before it starts your task. Its not recommended for small projects because of its resource heavy structure.

What are 3 important parts of MVC (MODEL-VIEW-CONTROLLER)?

1. The Model represents the application data
2. The View renders a presentation of model data
3. The Controller handles and routes requests made by the client

What is a component, helper and why are they used, is there other way we can do same thing, what is better?

A component is an independent piece of code written for specific task that can be used by calling in controllers (example : email component), helper is used for helping cakephp in rendering the data to be shown to user with views, these only adds to modularity in code otherwise same coding can be implemented in controllers.

What is features in cake php?

list some of the features in Cake php
1. Compatible with versions 4 and 5 of PHP
2. MVC architecture
3. Built-in validations
4. Caching
5. scaffolding
Scaffolding is a meta-programming method of building database-backed software applications. It is a technique supported by some model-view-controller frameworks, in which the programmer may write a specification that describes how the application database may be used. The compiler uses this specification to generate code that the application can use to create, read, update and delete database entries, effectively treating the template as a "scaffold" on which to build a more powerful application.

What is habtm?

Has and belongs to many is a kind of associations that can be defined in models for retrieving associated data across different entities.

Friday, May 6, 2011

What is meant by MVC (MODEL-VIEW-CONTROLLER)?

model view controller, it is a software architecture, used to isolates business logic from presentation logic. cakephp is based on mvc pattern.

What is the first file that gets loaded when you run an application using cakephp?

bootstrap.php , it can be changed , either through index.php , or through .htaccess

What is the first function that gets loaded from a controller?

index

What is the naming convention in cakephp?

Table names are plural and lowercased,model names are singular and CamelCased:ModelName, model file names are singular and underscored: model_name.php, controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are plural and underscored with *controller* appended: controller_names_controller.php, associations should use the ModelName, and the order should match the order of the foreignKeys: var $belongsTo = ‘User’; , foreign keys should always be: table_name_in_singular_form_id: user_id (foreign key) → users (table) , many-to-many join tables should be named: alphabetically_first_table_plural_alphabetically_second_table_plural: tags_users , columns in many-to-many join tables should be named like other foreign keys: tag_id and user_id , columns named “created” and “modified” will automatically be populated correctly

what is cakephp?

Cakephp is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. it uses commonly known design patterns like MVC,ORM within the convention over configuration paradigm, It also reduces development costs and helps developers write less code.

what is the name of Cake's database configuration file?

By default it is database.php.default, you can find it in /app/config/database.php.default
for connecting to database, it should be renamed to database.php

Explain MVC Architecture in Php with example

Model-View-Controller is the concept introduced by Smalltalk's inventors to encapsulating some data together with its processing (the model) and isolate it from the manipulation (the controller) and presentation (the view) part that has to be done on a UserInterface.
A model :- is an object representing data e.g. a database table.
A view :- is some form of visualization of the state of the model.
A controller :- offers facilities to change the state of the model.
<?php
//////////////My Property Class////////////
// it contain getter setter function
abstract class EmployeeProperty
{
private $deptid;
public function getDeptId() //Getter
{
return $this->deptid;
}
public function setDeptId($id) //setter
{
$this->deptid=$id;
}
}
//////////My Interface /////////
interface iEmployee
{
function getEmployeeName(EmployeeProperty $objEmployeeProperty);
}
/////////My Data access layer//////
// it fetch data from database server
//it model part of mvc
class DALEmployee implements iEmployee
{
public function getEmployeeName(EmployeeProperty $objEmployeeProperty)
{
$con = mysql_connect("localhost","root","root"); //open connection
if (!$con)
{
die('Could not connect to mysql ' . mysql_error()); // error message
}
else
{
mysql_select_db("test",$con); // select database
$result= mysql_query("select emp_name from employee where deptid=".$objEmployeeProperty-> getDeptId()); // fire query
mysql_close($con); // close connection
}
return $result;
}
}
///////////My business logic layer////////
// it is controller part of mvc
class BALEmployee extends EmployeeProperty
{
public function getEmployeeName(EmployeeProperty $objEmployeeProperty)
{
$objiEmployee=new DALEmployee();
return $objiEmployee->getEmployeeName($objEmployeeProperty);
}
}
?>
/////////////////////My View Part///////////////////////////////////////
New Document
<?php
include("Employee.php");
///////////////My View Part//////////////////
$objBALEmployee=new BALEmployee(); //Create object of business logic layer
$objBALEmployee->setDeptId(1); // Set Property
$result= $objBALEmployee->getEmployeeName($objBALEmployee); // excess bll function
while($row = mysql_fetch_row($result)) // fetch result
{
echo $row[0].""; // display result
}
?>

Saturday, April 9, 2011

How do you proceed when you have to use cakephp for any application?

Take the framework either from cake site or if you have changed according to your needs start from there. proceed with basic software engg. concepts as requirement gathering etc

What are hooks in Drupal ?

Allow modules to interact with the Drupal core.
Drupal's module system is based on the concept of "hooks". A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook. Each hook has a defined set of parameters and a specified result type.
To extend Drupal, a module need simply implement a hook. When Drupal wishes to allow intervention from modules, it determines which modules implement a hook and calls that hook in all enabled modules that implement it.

Friday, March 11, 2011

What is a Module in drupal ?

A module is software (code) that extends Drupal features and/or functionality. Core modules are those included with the main download of Drupal, and you can turn on their functionality without installing additional software. Contributed modules are downloaded from the Modules download section of drupal.org, and installed within your Drupal installation. You can also create your own modules; this requires a thorough understanding of Drupal, PHP programming, and Drupal's module API.

Thursday, March 10, 2011

Explain the concept of node in drupal.

A node in Drupal is the generic term for a piece of content on your web site. (Note that the choice of the word "node" is not meant in the mathematical sense as part of a network.)
Some examples of nodes:
• Pages in books
• Discussion topics in forums
• Entries in blogs
• News article stories
Each node on your site has a Content Type. It also has a Node ID, a Title, a creation date, an author (a user on the site), a Body (which may be ignored/omitted for some content types), and some other properties. By using modules such as the contributed Content Construction Kit (CCK) module, the core Taxonomy module, and the contributed Location module, you can add fields and other properties to your nodes.

Wednesday, February 9, 2011

What is XML-RPC?

XML-RPC is a protocol that uses XML messages to perform Remote Procedure Calls. Requests are encoded in XML and sent via HTTP POST; XML responses are embedded in the body of the HTTP response.
More succinctly, XML-RPC = HTTP + XML + Remote Procedure Calls.
Because XML-RPC is platform independent, diverse applications can communicate with one another. For example, a Java client can speak XML-RPC to a Perl server.
To get a quick sense of XML-RPC, here is a sample XML-RPC request to a weather service (with the HTTP Headers omitted):
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodCall>
<methodName>weather.getWeather</methodName>
<params>
<param><value>10016</value></param>
</params>
</methodCall>
The request consists of a simple element, which specifies the method name (getWeather) and any method parameters (zip code).
Here is a sample XML-RPC response from the weather service:
<?xml version="1.0" encoding="ISO-8859-1"?>
<methodResponse>
<params>
<param>
<value><int>65</int></value>
</param>
</params>
</methodResponse>
The response consists of a single element, which specifies the return value (the current temperature). In this case, the return value is specified as an integer.
In many ways, XML-RPC is much simpler than SOAP, and therefore represents the easiest way to get started with Web services.
The official XML-RPC specification is available at XML-RPC.com. Dozens of XML-RPC implementations are available in Perl, Python, Java, and Ruby. See the XML-RPC home page for a complete list of implementations.

What is the Web service protocol stack?

The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services.
The core protocol stack consists of four layers:
Service Transport: This layer is responsible for transporting messages between applications. Currently, this includes HTTP, SMTP, FTP, and newer protocols, such as Blocks Extensible Exchange Protocol (BEEP).
XML Messaging: This layer is responsible for encoding messages in a common XML format so that messages can be understood at either end. Currently, this includes XML-RPC and SOAP.
Service Description: This layer is responsible for describing the public interface to a specific Web service. Currently, service description is handled via the WSDL.
Service Discovery: This layer is responsible for centralizing services into a common registry, and providing easy publish/find functionality. Currently, service discovery is handled via the UDDI.
Beyond the essentials of XML-RPC, SOAP, WSDL, and UDDI, the Web service protocol stack includes a whole zoo of newer, evolving protocols. These include WSFL (Web Services Flow Language), SOAP-DSIG (SOAP Security Extensions: Digital Signature), and USML (UDDI Search Markup Language).
Fortunately, you do not need to understand the full protocol stack to get started with Web services. Assuming you already know the basics of HTTP, it is best to start at the XML Messaging layer and work your way up.

I keep reading about Web services, but I have never actually seen one. Can you show me a real Web service in action?

If you want a more intuitive feel for Web services, try out the IBM Web Services Browser, available on the IBM Alphaworks site. The browser provides a series of Web services demonstrations. Behind the scenes, it ties together SOAP, WSDL, and UDDI to provide a simple plug-and-play interface for finding and invoking Web services. For example, you can find a stock-quote service, a traffic-report service, and a weather service. Each service is independent, and you can stack services like building blocks. You can, therefore, create a single page that displays multiple services--where the end result looks like a stripped-down version of my.yahoo or my.excite.

What is a Web service?

A web service is any piece of software that makes itself available over the Internet and uses a standardized XML messaging system.
XML is used to encode all communications to a Web service.
For example, a client invokes a Web service by sending an XML message, then waits for a corresponding XML response. Because all communication is in XML, Web services are not tied to any one operating system or programming language--Java can talk with Perl; Windows applications can talk with Unix applications.
Beyond this basic definition, a Web service may also have two additional (and desirable) properties:
First, a Web service can have a public interface, defined in a common XML grammar. The interface describes all the methods available to clients and specifies the signature for each method. Currently, interface definition is accomplished via the Web Service Description Language (WSDL).
Second, if you create a Web service, there should be some relatively simple mechanism for you to publish this fact. Likewise, there should be some simple mechanism for interested parties to locate the service and locate its public interface. The most prominent directory of Web services is currently available via UDDI, or Universal Description, Discovery, and Integration.
Web services currently run a wide gamut from news syndication and stock-market data to weather reports and package-tracking systems. For a quick look at the range of Web services currently available, check out the XMethods directory of Web services.

What does 403 Forbidden mean?

403 Forbidden is the HTTP status code produced by a web server when you are not permitted to access a particular URL. Usually a 403 Forbidden error means that the page in question does exist but cannot be accessed by you.
Some websites are locked down so that only those on the local company or school network can access parts of the site. You will often see 403 Forbidden errors when browsing such sites from "off-campus."
 
Sometimes webmasters try to set up dynamic web programming features like PHP or Perl/CGI but fail to do so correctly. This can also result in 403 Forbidden errors until the web server is correctly configured.
 
403 Forbidden can appear in other situations at the discretion of the webmaster, so you may see it in scenarios other than these.

What is DNS?

Every time you follow a link or type in the name of a website, such as www.scriptscart.com, that name must be translated into an IP address on the Internet. This translation is done by the domain name system.
A DNS server is a program that participates in the task of providing this service. Some DNS servers respond to queries from web browsers and other programs, make further inquiries, and return IP addresses, such as 208.27.35.236. Other DNS servers have primary responsibility for answering DNS inquiries about names within a particular domain, such as the scriptscart.com domain. Every time a new domain is registered, a DNS server must be configured to give out address information for that domain, so that users can actually find websites in that domain. In most cases, web hosting companies provide this service for the domains that they host; it is rare for webmasters to run their own DNS servers.

What is SSL? How SSL Works ?

SSL (Secure Sockets Layer), also known as TLS (Transport Layer Security), is a protocol that allows two programs to communicate with each other in a secure way. Like TCP/IP, SSL allows programs to create "sockets," endpoints for communication, and make connections between those sockets. But SSL, which is built on top of TCP, adds the additional capability of encryption. The HTTPS protocol spoken by web browsers when communicating with secure sites is simply the usual World Wide Web HTTP protocol, "spoken" over SSL instead of directly over TCP.
In addition to providing privacy, SSL encryption also allows us to verify the identity of the party we are talking to. This can be very important if we don't trust the Internet. While it is unlikely in practice that the root DNS servers of the Internet will be subverted, a "man in the middle" attack elsewhere on the network could substitute the address of one Internet site for another. SSL prevents this scenario by providing a mathematically sound way to verify the other program's identity. When you log on to your bank's website, you want to be very, very sure you are talking to your bank!
SSL provides both privacy and security using a technique called "public/private key encryption" (often called "asymmetric encryption" or simply "public key encryption").
A "public key" is a string of letters and numbers that can be used to encrypt a message so that only the owner of the public key can read it. This is possible because every public key has a corresponding private key that is kept secret by the owner of the public key.

What is the difference between a web browser and a web server?

A web browser is what you're probably looking at right now: a program on yourcomputer that shows you stuff that's on the web. A web server is a program on a server computer, somewhere out on the Internet, that delivers web pages to web browsers.
The term web server also refers to an actual, physical computer that is running web server software.

What is a web server? How Web Servers Work?

A web server is a computer program that delivers (serves) content, such as web pages, using the Hypertext Transfer Protocol (HTTP), over the World Wide Web. The term web server can also refer to the computer or virtual machine running the program.
In large commercial deployments, a server computer running a web server can be rack-mounted with other servers to operate a web farm.
The primary function of a web server is to deliver web pages to clients. This means delivery of HTML documents and any additional content that may be included by a document, such asimages, style sheets and JavaScripts.
A client, commonly a web browser or web crawler, initiates communication by making a request for a specific resource using HTTP and the server responds with the content of that resource, or an error message if unable to do so. The resource is typically a real file on the server's secondary memory, but this is not necessarily the case and depends on how the web server is implemented.

What is .htaccess?

.htaccess is an extension of the Directory Hierarchy that serves to enable users to set directives for themselves, subject to permissions (AllowOverride) set up by the server administrator.