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?If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?Is it possible to set a time expire page in PHP?How can I embed a java programme in php file and what changes have to be done in php.ini file? ~ Interview Questions & Answers

Wednesday, February 9, 2011

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.

Wednesday, November 3, 2010

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?

5, it’s a reference to existing variable.

Tuesday, August 3, 2010

Is it possible to set a time expire page in PHP?

Yes it is Using header("Expires: Mon, 26 Jul 2007 05:00:00 GMT");<?php header("Expires: Mon, 26 Jul 2007 05:00:00 GMT"); ?>

How can I embed a java programme in php file and what changes have to be done in php.ini file?

There are two possible ways to bridge PHP and Java: you can either integrate PHP into a Java Servlet environment, which is the more stable and efficient solution, or integrate Java support into PHP. The former is provided by a SAPI module that interfaces with the Servlet server, the latter by this Java extension.
The Java extension provides a simple and effective means for creating and invoking methods on Java objects from PHP. The JVM is created using JNI, and everything runs in-process.
Example Code:
getProperty('java.version') . '';
echo 'Java vendor=' . $system->getProperty('java.vendor') . '';
echo 'OS=' . $system->getProperty('os.name') . ' ' . $system->getProperty('os.version') . ' on ' . $system->getProperty('os.arch') . ' ';
// java.util.Date example $formatter = new Java('java.text.SimpleDateFormat', "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz");
echo $formatter->format(new Java('java.util.Date')); ?>
The behaviour of these functions is affected by settings in php.ini.
Table 1. Java configuration options
Name
Default
Changeable
java.class.path
NULL
PHP_INI_ALL
Name Default Changeable
java.home
NULL
PHP_INI_ALL
java.library.path
NULL
PHP_INI_ALL
java.library
JAVALIB
PHP_INI_ALL