php tutorial-for beginners

PHP Functions | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,N...

PHP Sessions | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,Ne...

Cookies Versus Sessions? | PHP Interview Questions,PHP tutorial,seo-tips,seo...


PHP Web-Related Variables | PHP Interview Questions,PHP tutorial,seo-tips,se...


MySQL Data on the Web | PHP Interview Questions,PHP tutorial,seo-tips,seo Tu...


php and pdf | php Interview Questions,php tutorial,seo-tips,seo tutorial,Net...

Top Directories submission | PHP Interview Questions,PHP tutorial,seo-tips,...

$_ENV and $_SERVER ? | PHP Interview Questions,PHP tutorial,seo-tips,seo Tut...


What is the use of PEAR in php? | php Interview Questions,php tutorial,seo-t...


SELECTING DATA IN PHP | PHP Interview Questions,PHP tutorial,seo-tips,seo Tu...


THE DIFFERENT TYPES OF ERRORS IN PHP? | PHP Interview Questions,PHP tutorial...


What is the maximum size of a file that can be uploaded using PHP and how ca...


MySQL Database Using PHP | PHP Interview Questions,PHP tutorial,seo-tips,seo...


php file_get_contents | php Interview Questions,php tutorial,seo-tips,seo Tu...


How to prevent hijacking in PHP? | PHP Interview Questions,PHP tutorial,seo...


Php Mysql Image upload | Php Interview Questions,Php tutorial,seo-tips,seo T...


What is LAMP? | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,...


Substrings PHP | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,...

 
Substrings PHP | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,...


PHP MySQL Functions | PHP Interview Questions,PHP tutorial,seo-tips,seo Tuto...


PHP Zip File Functions | PHP Interview Questions,PHP tutorial,seo-tips,seo T...


What are the different tables present in mysql? | PHP Interview Questions,PH...


magic methods? | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,...


$_GET , $_POST,$_COOKIE?? | PHP Interview Questions,PHP tutorial,seo-tips,se...


How get the value of current session id? | PHP Interview Questions,PHP tut...


How register the variables into a session? | PHP Interview Questions,PHP tu...


What is CURL? | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,N...


Free Hosting | PHP Interview Questions,PHP tutorial,seo-tips,seo tutorial,N...

 
 MySQL|PHP Interview Questions,PHP tutorial,seo-tips,seo Tutorial,Networking,...
 

What Is IP Filtering?

IP filtering is simply a mechanism that decides which types of IP packets will be processed normally and which will be dropped or rejected. By dropped we mean that the packet is deleted and completely ignored, as if it had never been received. By rejected we mean that the firewall sends an ICMP response to the sender indicating a reason why the packet was rejected. You can apply many different sorts of criteria to determine which packets you wish to filter. Some examples of these are:
  • Protocol type: TCP, UDP, ICMP, etc.
  • Port number (for TCP/UPD)
  • Packet type: SYN/ACK, data, ICMP Echo Request, etc.
  • Packet source address: where it came from
  • Packet destination address: where it is going to
It is important to understand at this point that IP filtering is a network layer facility. This means that it doesn't understand anything about the application using the network connections, only about the connections themselves. For example, you may deny users access to your internal network on the default Telnet port, but if you rely on IP filtering alone, you can't stop them from using the Telnet program with a port that you do allow to pass through your firewall. You can prevent this sort of problem by using proxy servers for each service that you allow across your firewall. The proxy servers understand the application that they were designed to proxy and can therefore prevent abuses, such as using the Telnet program to get past a firewall by using the World Wide Web port. If your firewall supports a World Wide Web proxy, outbound Telnet connections on the HTTP port will always be answered by the proxy and will allow only HTTP requests to pass. 

The IP filtering rule set is made up of many combinations of the criteria listed previously. For example, let's imagine that you wanted to allow World Wide Web users within the Virtual Brewery network to have no access to the Internet except to use other sites' web servers. You would configure your firewall to allow forwarding of the following:
  • Packets with a source address on Virtual Brewery network, a destination address of anywhere, and with a destination port of 80 (WWW)
  • Packets with a destination address of Virtual Brewery network and a source port of 80 (WWW) from a source address of anywhere
Note that we've used two rules here. We have to allow our data to go out, but also the corresponding reply data to come back in. In practice, as we'll see in the chapter on IP masquerade and Network Address Translation

What is data management?

The control of data from acquisition and input through processing, output, and storage. In microcomputers, hardware manages data by gathering it, moving it, and following instructions to process it. The operating system manages the hardware and ensures that the parts of the system work in harmony so that data is stored safely and accurately. Application programs manage data by receiving and processing input according to the user’s commands, and sending results to an output device or to disk storage. The user also is responsible for data management by acquiring data, labeling and organizing disks, backing up data, archiving files, and removing unneeded material from the hard disk.

HTTP status codes

Three-digit codes sent by an HTTP server that indicate the results of a request for data. Codes beginning with 1 respond to requests that the client may not have finished sending; with 2, successful requests; with 3, further action that the client must take; with 4, requests that failed because of client error; and with 5, requests that failed because of server error.
400, 401, 402, 403, 404, HTTP

.NET Framework

A platform for building, deploying, and running XML Web services and applications. It provides a highly productive, standards-based, multilanguage environment for integrating existing investments with next generation applications and services, as well as the agility to solve the challenges of deployment and operation of Internet-scale applications. The .NET Framework consists of three main parts: the common language runtime, a hierarchical set of unified class libraries, and a componentized version of ASP called ASP.NET. See also ASP.NET, common language runtime, .NET Framework class library. 

NET Framework class library  
 A Common Language Specification (CLS)–compliant library of classes, interfaces, and value types that are included in the Microsoft .NET Framework SDK. This library provides access to system functionality and is designed to be the foundation on which .NET Framework applications, components, and controls are built.

.NET Framework data provider :- A component of ADO.NET that provides access to data from a relational data source. A .NET Framework data provider contains classes to connect to a data source, execute commands at the data source, and return query results from the data source, including the ability to execute commands within transactions. A .NET Framework data provider also contains classes to populate a DataSet with results from a data source and propagate changes in a DataSet back to the data source.

What is GPS receiver?

A device that includes an antenna, a radio receiver, and a processor for use with the worldwide GPS -Global Positioning System. A GPS receiver uses position and time information from four GPS satellites to calculate precise information about its current location, its speed of travel, and the current time. A portable GPS receiver may be a stand-alone device or a plug-in unit for use with a portable computer. GPS receivers are used for scientific work, such as surveying, mapping, and studies of volcanoes, as well as for land, sea, and air navigation. On the consumer front, they are used in outdoor activities such as hiking and sailing and in cars to provide location, destination, and traffic information.

What is ini file?

ini file:-Short for initialization file, a text file containing information about the initial configuration of Windows and Windows-based applications, such as default settings for fonts, margins, and line spacing. Two ini files, win.ini and system.ini, are required to run the Windows operating system through version 3.1. In later versions of Windows, ini files are replaced by a database known as the registry. In addition to Windows itself, many older applications create their own ini files. Because they are composed only of text, ini files can be edited in any text editor or word processor to change information about the application or user preferences. All initialization files bear the extension .ini. 

MS-DOS and Windows 3.x, the file extension that identifies an initialization file, which contains user preferences and startup information about an application program

what is three-tier client/server?

A client/server architecture in which software systems are structured into three tiers or layers: the user interface layer, the business logic layer, and the database layer. Layers may have one or more components. For example, there can be one or more user interfaces in the top tier, each user interface may communicate with more than one application in the middle tier at the same time, and the applications in the middle tier may use more than one database at a time. Components in a tier may run on a computer that is separate from the other tiers, communicating with the other components over a network.

Whst is Password Authentication Protocol

Acronym for Password Authentication Protocol. A method for verifying the identity of a user attempting to log on to a Point-to-Point Protocol (PPP) server. PAP is used if a more rigorous method, such as the Challenge Handshake Authentication Protocol (CHAP), is not available or if the user name and password that the user submitted to PAP must be sent to another program without encryption. 2. Acronym for Printer Access Protocol. The protocol in AppleTalk networks that governs communication between computers and printers.

Javascript Array

Creating an Object

We have already seen an example of an Array object being created. To create an Array object, we used the JavaScript statement
var myArray = new Array();
So how is this statement made up?
The first half of the statement is familiar to us. We use the var keyword to define a variable called myArray. This variable is initialized, using the assignment operator (=), to the right-hand side of the statement.
The right-hand side of the statement consists of two parts. First we have the keyword new. This tells JavaScript that we want to create a new object. Next we have Array(). This is the constructor for an Array object. It tells JavaScript what type of object we want to create. Most objects have constructors like this. For example, the Date object has the Date() constructor.


we can pass parameters to the constructor Array() to add data to our object. For example, to create an Array object that has three elements containing the data "Paul", "Paula", and "Pauline", we use
var myArray = new Array("Paul", "Paula", "Pauline");
Let's see some more examples, this time using the Date object. The simplest way of creating a Date object is
var myDate = new Date();
This will create a Date object containing the date and time that it was created. However,
var myDate = new Date("1 Jan 2000");
will create a Date object containing the date 1 January 2000.
How object data is stored in variables differs from how primitive data, such as text and numbers, is stored. (Primitive data is the most basic data possible in JavaScript.) With primitive data, the variable holds the data's actual value. For example
var myNumber = 23;
means that the variable myNumber will hold the data 23. However, variables assigned to objects don't hold the actual data, but rather a reference to the memory address where the data can be found. This doesn't mean we can get hold of the memory address—this is something only JavaScript has details of and keeps to itself in the background. All you need to remember is that when we say that a variable references an object, this is what we mean. We show this in the following example:
var myArrayRef = new Array(0, 1, 2);
var mySecondArrayRef = myArrayRef;
myArrayRef[0] = 100;
alert(mySecondArrayRef[0]);
First we set variable myArrayRef reference to the new array object, and then we set mySecondArrayRef to the same reference—for example, now mySecondArrayRef is set to reference the same array object. So when we set the first element of the array to 100 as shown here:
myArrayRef [0] = 100;
and display the contents of the first element of the array referenced in mySecondArrayRef as follows:
alert(mySecondArrayRef[0])
we'll see it also magically has changed to 100! However, as we now know, it's not magic; it's because both variables referenced the same array object because when it comes to objects, it's a reference to the object and not the object stored in a variable. When we did the assignment, it didn't make a copy of the array object, it simply copied the reference. Contrast that with the following:
var myVariable = "ABC";
var mySecondVariable = myVariable;
myVariable = "DEF";
alert(mySecondVariable);
In this case we're dealing with a string, which is primitive data type, as are numbers. This time it's the actual data that's stored in the variable, so when we do this:
var mySecondVariable = myVariable;
mySecondVariable gets its own separate copy of the data in myVariable. So the alert at the end will still show mySecondVariable as holding "ABC."
To summarize this section, we create a JavaScript object using the following basic syntax:
var myVariable = new ObjectName(optional parameters);

Creating a Cookie-Javascript

To make life easier for ourselves, we'll write a function that allows us to create a new cookie and set certain of its attributes with more ease. We'll look at the code first and create an example using it shortly.
function setCookie(cookieName, cookieValue, cookiePath, cookieExpires)
{
   cookieValue = escape(cookieValue);
   if (cookieExpires == "")
   {
      var nowDate = new Date();
      nowDate.setMonth(nowDate.getMonth() + 6);
      cookieExpires = nowDate.toGMTString();
   }
   if (cookiePath != "")
   {
      cookiePath = ";Path=" + cookiePath;
   }
   document.cookie = cookieName + "=" + cookieValue +
      ";expires=" + cookieExpires + cookiePath;
}
The secure and domain parts of the cookie string are unlikely to be needed, so we just allow the name, value, expires, and path parts of a cookie to be set by the function. If we don't want to set a path or expiration date, we just pass empty strings for those parameters. If no path is specified, the current directory and its subdirectories will be the path. If no expiration date is set, we just assume a date six months from now.
The first line of the function introduces the escape() function, which we've not seen before.
cookieValue = escape(cookieValue);
When we talked about setting the value of a cookie, we mentioned that certain characters cannot be used directly, such as a semicolon. (This also applies to the name of the cookie.) To get around this problem, we can use the built-in escape() and unescape() functions.


alert(escape("2001 a space odyssey;"));
We can see that the spaces have been converted to %20, % indicating that they represent an escape or special character rather than an actual character, and that 20 is the ASCII value of the actual character. The semicolon has been converted to %3B, as we'd expect.
As we'll see later, when retrieving cookie values we can use the unescape() function to convert from the encoded version to plain text.
Back to our function; we next have an if statement.
   if (cookieExpires == "")
   {
      var nowDate = new Date();
      nowDate.setMonth(nowDate.getMonth() + 6);
      cookieExpires = nowDate.toGMTString();
   }
This deals with the situation where an empty string, "", has been passed for the cookieExpires parameter of the function. Because most of the time we want a cookie to last longer than the session it's created in, we set a default value for expires that is six months after the current date.
Next, if a value other than an empty string ("") has been passed to the function for the cookiePath parameter, we need to add that value when we create the cookie. We simply put "path=" in front of any value that has been passed in the cookiePath parameter.
   if (cookiePath != "")
   {
      cookiePath = ";Path=" + cookiePath;
   }
Finally on the last line we actually create the cookie, putting together the cookieName, cookieValue, cookieExpires, and cookiePath parts of the string.
   document.cookie = cookieName + "=" + cookieValue +
      ";expires=" + cookieExpires + cookiePath;
We'll be using the setCookie() function whenever we want to create a new cookie because it makes setting a cookie slightly easier than having to remember all the parts we want to set. More importantly, it can be used to set the expiration date to a date six months ahead of the current date.
For example, to use the function and set a cookie with default values for expires and path we just type the following:
setCookie("cookieName","cookieValue","","")

what is X Series for Network Communications

A set of recommendations adopted by the International Telecommunication Union Telecommunication Standardization Sector ITU-T, formerly the CCITT, and International Organization for Standardization ISO for standardizing equipment and protocols used in both public access and private computer networks.
Recommendation Number What It Covers
X.25 Interface required to connect a computer to a packet-switched network such as the Internet
X.75 Protocols for connecting two public data networks
X.200 Seven-layer set of protocols known as the ISO/OSI reference model for standardizing computer-to-computer connections
X.400 Format at the ISO/OSI application layer for e-mail messages over various network transports, including Ethernet, X.25, and TCP/IP. Gateways must be used to translate e-mail messages between the X.400 and Internet ­formats
X.445 Asynchronous Protocol Specification, which governs the transmission of X.400 messages over dial-up telephone lines
X.500 Protocols for client/server systems that maintain and access directories of users and resources in X.400 form
X.509 Digital certificates

What is MIME?

Acronym for Multipurpose Internet Mail Extensions. A protocol widely used on the Internet that extends the SMTP Simple Mail Transfer Protocol to permit data, such as video, sound, and binary files, to be transmitted by Internet e-mail without having to be translated into ASCII format first. This is accomplished by the use of MIME types, which describe the contents of a document. A MIME-compliant application sending a file, such as some e-mail programs, assigns a MIME type to the file. The receiving application, which must also be MIME-compliant, refers to a standardized list of documents that are organized into MIME types and subtypes to interpret the content of the file. For instance, one MIME type is text, and it has a number of subtypes, including plain and html. A MIME type of text/html refers to a file that contains text written in HTML. MIME is part of HTTP, and both Web browsers and HTTP servers use MIME to interpret e-mail files they send and receive. 

What is memory management?

In operating systems for personal computers, procedures for optimizing the use of RAM (random access memory). These procedures include selectively storing data, monitoring it carefully, and freeing memory when the data is no longer needed. Most current operating systems optimize RAM usage on their own; some older operating systems, such as early versions of MS-DOS, required the use of third-party utilities to optimize RAM usage and necessitated that the user be more knowledgeable about how the operating system and applications used memory. See also memory management unit, RAM. 2. In programming, the process of ensuring that a program releases each chunk of memory when it is no longer needed. In some languages, such as C and C++, the programmer must keep track of memory usage by the program. Java, a newer language, automatically frees any chunk of memory that is not in use. See also C, C++, garbage collection, Java. 

Memory management program :- A program used to store data and programs in system memory, monitor their use, and reassign the freed space following their execution. 2. A program that uses hard disk space as an extension of the random access memory RAM.  

Memory management unit :-The hardware that supports the mapping of virtual memory addresses to physical memory addresses. In some systems, such as those based on the 68020, the memory management unit is separate from the processor. In most modern microcomputers, however, the memory management unit is built into the CPU chip. In some systems, the memory management unit provides interfacing between the microprocessor and memory. This type of memory management unit is typically responsible for address multiplexing and, in the case of DRAMs, the refresh cycle. Acronym: MMU. See also physical address, refresh cycle, virtual address.

What is markup language?

A set of codes in a text file that instructs a computer how to format the file on a printer or video display or how to index and link its contents. Examples of markup languages are Hypertext Markup LanguageHTML and Extensible Markup Language XML, which are used in Web pages, and Standard Generalized Markup Language SGML, which is used for typesetting and desktop publishing purposes and in electronic
documents. Markup languages of this sort are designed to enable documents and other files to be platform-independent and highly portable between applications. See also HTML, SGML, XML.

why need For a relational database?

A database or database management system that stores information in tables—rows and columns of data—and conducts searches by using data in specified columns of one table to find additional data in another table. In a relational database, the rows of a table represent records (collections of information about separate items) and the columns represent fields (particular attributes of a record). In conducting searches, a relational database matches information from a field in one table with information in a corresponding field of another table to produce a third table that combines requested data from both tables. 


For example, if one table contains the fields EMPLOYEE-ID, LAST-NAME, FIRST-NAME, and HIRE-DATE, and another contains the fields DEPT, EMPLOYEE-ID, and SALARY, a relational database can match the EMPLOYEE-ID fields in the two tables to find such information as the names of all employees earning a certain salary or the departments of all employees hired after a certain date. In other words, a relational database uses matching values in two tables to relate information in one to information in the other. Microcomputer database products typically are relational databases. Compare flat-file database, inverted-list database.

Os registry?

A central hierarchical database in Windows 9x, Windows CE, Windows NT, and Windows 2000 used to store information necessary to configure the system for one or more users, applications, and hardware devices. The Registry contains information that Windows continually references during operation, such as profiles for each user, the applications installed on the computer and the types of documents each can create, property sheet settings for folders and application icons, what hardware exists on the system, and which ports are being used.

 The Registry replaces most of the text-based .ini files used in Windows 3. x and MS-DOS configuration files, such as AUTOEXEC.BAT and CONFIG.SYS. Although the Registry is common to the several Windows platforms, there are some differences among them. Also called: system registry. See also hierarchical database, .ini, input/output port, property sheet, Registry Editor.

Whai is macro?

In applications, a set of keystrokes and instructions recorded and saved under a short key code or macro name. When the key code is typed or the macro name is used, the program carries out the instructions of the macro. Users can create a macro to save time by replacing an often-used, sometimes lengthy, series of strokes with a shorter version. 2. In programming languages, such as C or assembly language, a name that defines a set of instructions that are substituted for the macro name wherever the name appears in a program a process called macro expansion when the program is compiled or assembled.

 Macros are similar to functions in that they can take arguments and in that they are calls to lengthier sets of instructions. Unlike functions, macros are replaced by the actual instructions they represent when the program is prepared for execution; function instructions are copied into a program only once.

What is modem?

Short for modulator/demodulator. A communications device that converts between digital data from a computer or terminal and analog audio signals that can pass through a standard telephone line. Because the telephone system was designed to handle voice and other audio signals and a computer processes signals as discrete units of digital information, a modem is necessary at both ends of the telephone line to exchange data between computers. At the transmit end, the modem converts from digital to analog audio; 
at the receiving end, a second modem converts the analog audio back to its original digital form.

 In order to move a high volume of data, high-speed modems rely on sophisticated methods for “loading” information onto the audio carrier—for example, they may combine frequency shift keying, phase modulation, and amplitude modulation to enable a single change in the carrier’s state to represent multiple bits of data. In addition to the basic modulation and demodulation functions, most modems also include firmware that allows them to originate and answer telephone calls. International standards for modems are specified by the International Telecommunications Union, or ITU. 

Despite their capabilities, modems do require communications software in order to function. See also amplitude modulation, frequency modulation, quadrature amplitude modulation. Compare digital modem. 2. Any communications device that acts as an interface between a computer or terminal and a communications channel. Although such a device may not actually modulate or demodulate analog signals, it may be described as a modem because a modem is perceived by many users to be a black box that connects a computer to a communications line such as a high-speed network or a cable TV system.