
Today I find another new logo of Google.But maybe it has set for any special day.:)

Today I find another new logo of Google.But maybe it has set for any special day.:)
Yester day I get a news from bangla blog that it is possible to chat without having messenger.I have become wonder .It is good for me because messenger is not allowed at my campus. From now using website I can be stay in touch with my favourite persons.
Roobon Da told me at morning that I can use multiple ID through Trillian.As soon as possible i will download it and I will use it.Very very special Thanks to Roobon Da.
A variable is a holder for a type of data. So, based on its type, a variable can hold numbers, strings, booleans, objects, resources or it can be NULL. The variable name consists of letters, numbers and/or the underscore character (“_”), preceded by a dollar (“$”) sign. It cannot include spaces or non-alphanumeric characters. Here are some possible variable names: “$i”, “$a_very_long_variable_name”, “$6723”, “$TotalRESULT”. You should keep your variable names short and descriptive. A variable named “$f” is unlikely to mean much to you when you return to your code after a month or so. On the other hand, a variable named “$filename”, should make more sense.
The contents of a variable can be changed at any time, and so can its type. To declare a variable, you must include it in your script. You can declare a variable and assign it a value in the same statement. For example:
$number1 = 8; //assigns the value “8” to a variable called “$number1”
print $number1; //outputs the value that the variable “$number1” holds
This statement declares a variable using the assignment operator (“=”). The variable is called “$number1”, and it holds the value “8”. After the assignment, you can treat the variables as if they were values, so “print $number1” is equivalent to “print 8”, that is, if “$number” holds the value “8”. Remember that sometimes it is important to know the type of data a variable holds, so make sure that a variable contains an integer or a float before using it in a mathematical calculation, for example.
An interesting feature in PHP is dynamic variables. This means that a variable name can be stored into variable itself. Let’s consider the following:
$product = “computer”; //defines a variable called “$product”
$$product = “IBM”; //defines another variable called “$computer”
After parsing these two lines, PHP will a variable called “$computer” and assign it the value “IBM”. This little script is equivalent to:
$product = “computer”;
$computer = “IBM”;
This means that “$$product” is equivalent to “$computer”, because the variable “$product” holds the value “computer”.
Another nice feature is variable referencing. By default, variables are assigned by value. In other words, if you were to assign “$varA” to “$varB”, a copy of the value held in “$varA” would be then assigned to “$varB”. So if you change the value of “$varA”, it has absolutely no effect on “$varB”:
$varA = “one”; //assigns “one” to “$varA”
$varB = $varA; //assigns the value that “$varA” holds to “$varB”
$varA = “two”; //assigns “two” to “$varA”
print $varB; //outputs the value that “$varB” holds
This script outputs “one”, so the value of “$varB” is not changed in any way. On the other hand, you can assign a variable a reference to another variable by adding an ampersand (&) in front of the “$varA” when assign the value to “$varB”:
$varA = “one”; //assigns “one” to “$varA”
$varB = &$varA; //assigns a reference of “$varA” to “$varB”
$varA = “two”; //assigns “two” to “$varA”
print $varB; //outputs the value that “$varB” holds
This outputs “two”. Why, you ask? Because $varB holds a reference to $varA’s value, rather than a copy of its contents. So all changes made to $varA are seen when accessing $varB. In other words, both $varA and $varB now point to the same value.
While variables offer a flexible way of storing data, and you can freely change their values and the type of data they store at any time, you may sometimes want to work with a value that you don’t want to alter. This is where constants come in. You can use the PHP function define() to create a constant. After you’ve done this, its value cannot be changed. That value can only be a number or a string. You should know that by convention, the name of the constant should be in capitals. Unlike variables, constants don’t require a dollar symbol before their name:
define(“MAXIMUM_MARK”, 10); //defines a constant called “MAXIMUM_MARK”
define(“NAME”, “John Smith”); //defines a constant called “NAME”
print “Welcome ” . NAME; //outputs the value that the constant “NAME” holds
This outputs “Welcome John Smith”. Notice the concatenation operator (“.”), which appends the string “Welcome” and adds our constant.
PHP also provides a number of built-in constants for you. “__FILE__”, for example, returns the name of the file currently being read by the interpreter. “__LINE__” returns the line number of the file. These constants are useful for generating error messages. You can also find out which version of PHP is interpreting the script using the “PHP_VERSION” constant.
PHP uses different types of data in its many functions. For example, if you have a script that adds up two numbers, you need to provide two numbers. If a script searches a text within another text, you need to provide two series of characters. These are two simple types of data.
Different types of data take up different amounts of memory and may be treated differently when they are manipulated in a script – for example, a number between 0 and 255 uses only one byte of memory; the series of characters “Johnny” uses 6 bytes of memory – therefore some programming languages demand that the programmer declares in advance which type of data a variable will contain, so they will know how much memory to allocate. PHP doesn’t require you to declare the type of data a variable will use, and just interprets the data according to the context in which that data is used. For example, if you provide a function with a number instead of some characters, the function will treat the number as a set of characters. It will do this, but without changing the type of the data; instead, it will use its own interpretation of that data.
Some of the most common types in PHP are: boolean, integer, floating-point number and string. A boolean type expresses a truth value, so it can be either “TRUE” or “FALSE”. An integer is a whole or real number, meaning a number without a decimal point. On the other hand, a floating-point number (also called float, double, or real number) is a number that includes a decimal point. A string is a collection of characters; when you work with strings in your scripts, they should always be surrounded by double (") or single (') quotation marks. Arrays and objects are also important data types in PHP, but we’ll talk about those later.
You can use PHP’s built-in function gettype() to test the type of any data, and settype() to change the type of that data. You can also change the type by casting, which means that you place the type in brackets in front of the data, thus instructing PHP to create a copy of that data’s value converted to the type you specified. The main difference between settype() and a cast is the fact that casting produces a copy, leaving the original data untouched.
Another important type of data in PHP is “NULL”. If a data has no assigned value, or its value has been unset using the unset() function, then that data is null. NULL is the only possible value of type NULL.
Special functions require you to use special types of data called resources. These data hold references to an external application, for example handlers to opened files, database connections, images, so you cannot convert any value to a resource; it can only be manipulated by a limited number of functions.
Let’s get back to the script we used before:
<?php
print "Hello Web!";
?>
In this simple script you can see some of the most used components of a PHP script. First off, PHP tags are used to separate the actual PHP content from the rest of the file. You can inform the interpreter that you want it to execute your commands by adding a pair of these: standard tags “<?php ?>”; short tags “<? ?>”; ASP tags “<% %>”; script tags “<SCRIPT LANGUAGE=”php”> </SCRIPT>”. The standard and the script tags are guaranteed to work under any configuration, the other two need to be enabled in your “php.ini”
Now that you know how to define a block of PHP code, take a closer look at the code above. The “print” function is used to output data, so anything output by “print()” ends up in the HTML file. Therefore, you can say that a function is a command that performs an action. Usually, you send some data to the function, and the function uses that data to come up with a result. There are a lot functions in PHP, and almost each one performs a different action. Data sent to a function is almost always placed in parentheses after the function name; there are some exceptions where parentheses are optional, and the “print()” function is one of them.
After that first line of code, you can see a semicolon. This semicolon informs the interpreter that you have completed a statement – a statement is to PHP what a sentence is to the English language. It represents an instruction to the interpreter, and some additional data. If PHP doesn’t find a semicolon at the end of your statement, then it will continue parsing the file until it finds one, ignoring any white-spaces or empty lines. So, your one statement doesn’t necessarily have to use only one line of code. There can be two or more statements on a single line, but, on the other hand, a statement could use two or more lines. PHP also ignores white spaces, so you can have as many blanks as you want between the statements, and between the statements’ parameters. You should know that you don’t have to use a semicolon with the last statement in your script (just before the closing tag). So the following scripts are equivalent:
<?php
print "This is a test" ;
?>
<?php print "This is a test" ?>
Commenting you PHP code can be very helpful. If some code seems to be very clear at the time of writing, the same code can look like a black hole a few weeks later, when you want to modify it. So adding comments to your code can save you time later on, and make it easier for other people to work with your code. But, wait, what is a comment? A comment is a text in a script that is ignored by the interpreter. So you can write anything you want in it, from copyright notices to detailed information about your code. PHP recognizes a comment by checking out if it contains two forward slashes (“//”) or a single hash sign (“#”). The text beginning from either of these marks until the end of the line is ignored. You can also use multi-line comments. They begin with a forward slash followed by an asterisk (“/*”) and end with an asterisk followed by a forward slash (“*/”):
<?php
/*
This is a demo script.
All it does is output Hello Web! in your browser.
*/
print "Hello Web!"; //outputs a message
//copyright (C) sharifinfotech.com 2006
?>
Writing PHP code is very easy. You don’t need specialized software to do this, all the tools should be found in a new installation of your operating system. Let’s start off with a little script and analyze its contents. PHP files are made up of plain text, just like a HTML document. So open your favorite text editor, and type the following:
<?php
print "Hello Web!";
?>
Always remember to save PHP’s files with the extension ".php" – this is very important, because it tells the server to how to treat these files, and run the appropriate interpreter to "understand" their contents. So just go ahead and give it an easy-to-remember name like "hello.php". If you run the web-server on your own computer, copy the file to the root location of your web-server – you can find this in your web-server’s documentation. If you’re not running the server on your computer, then you must upload the file to your server. You can do this using a FTP client. After you’ve put your script where it should belong, you must open it via your web-browser, so point your web-browser to the path of the script according to your server’s address – for example, if you’re running a server on your own computer, then just load into your web-browser the file http://localhost/hello.php
If everything goes ok, then you will see "Hello Web!" (without the quotation marks) in your web-browser’s output window. If PHP is not installed or the server didn’t recognize the file’s extension, you will see the source code of the script (the script itself).
While the above script is pure PHP, you can incorporate it into a HTML document. So go ahead create a file named "hello2.php" under your web-server root directory with the following content:
<html>
<head>
<title>PHP Test 2</title>
</head>
<body>
<?php print "<b>Hello Web!</b>"; ?>
</body>
</html>
You can easily see now that PHP only parses the text between the PHP tags ("<?php (…) ?>"), and replaces this text with the output of the script. The rest of the script is left alone, and is forwarded as-is to the web-browser. This way you will be able to combine both HTML and PHP in the same page. This is how the file will look like after being parsed by PHP:
<html>
<head>
<title>PHP Test 2</title>
</head>
<body>
<b>Hello Web!</b>
</body>
</html>
As you can see, incorporating HTML into a PHP document is simply a matter of typing in the code. The output of this last script will be pretty much the same as the first one, except that the new document will also have a title: "PHP Test 2", and the welcome message will be written using bold characters.
You can include as many blocks of PHP code as you need in a single document, combining them with HTML as required. Although you can have multiple blocks of code in a single document, they combine to form a single script. Anything defined in the first block (variables, functions, or classes, for example) usually will be available to subsequent blocks.
The First step of my dream become true.Now I am developing my dream. This is less important for everyone but for me it is so important.
After installing PHP, the next step would be configuring its many options. In order to do this, you must edit the configuration file, which should be called "php.ini". PHP reads this file when it starts, so you shouldn’t expect your changes to apply as soon as you’ve modified the file, you have to restart the web-server after you’ve changed PHP’s configuration file!
The configuration file is not provided with PHP; instead, there are two templates which should help you decide on PHP settings: a development purposes template "php.ini-dist" – and a production site template "php.ini-recommended". If no configuration file is used, then PHP will use the factory settings.
If you intend to use PHP for learning and development, you should definitely use the first template. If you will use PHP for production purposes, you should go with the second template. This second one makes PHP more efficient and more secure. Unfortunately, this way of improving PHP’s performance may make it incompatible with some applications, and may prove to be difficult to develop with. So go ahead and choose the one it suits you best, and then copy it under the name "php.ini" in its intended location – you can find out where PHP looks for its configuration file if you read the documentation. The locations of the configuration file may differ for each platform, so, for example, on UNIX-systems you should place it in "/usr/local/lib/"; on a Windows system, the default location is the Windows directory. A "php.ini" file in the current working directory will override one in the default location, so it’s easy to change the behavior of PHP on a per-directory basis.
The configuration file is fully commented, so you can go over each one setting and see the effect on your application, and then decide weather to modify it or not. Changing the values is actually very easy, you just have to open the configuration file in your favorite text file editor, and simply modify the settings according to your needs. Again, remember to restart the web-server after you’ve altered the configuration file.
The settings in the php.ini file take the form of a setting name and a value separated by an equals sign. White spaces between these two are ignored; a semicolon instructs PHP not to take into consideration the text that follows the semicolon, until the end of the line. Most settings’ names are suggestive to their behavior, and you will find some useful descriptions before each setting.
Before you start programming with PHP, you must first acquire, install, and configure the PHP interpreter. PHP is available for a lot of platforms, and works in conjunction with many web-servers. Along with PHP itself and a web-server you also need a web-browser, so you can view the outcome of your work.
The latest version of PHP can be downloaded from www.php.net; after the download is complete, don�t forget to unpack the archive. There are two available downloads: the source code, which you can use to compile PHP, and the binary version of PHP, which means that it�s already compiled. If you�re new in the business, you should go with the binary version, for it will save you from a lot of headaches. If you don�t have already installed a web-server, you should go ahead install one for your operating system (for example Apache on Linux, and IIS or Apache on Windows); a web browser is also required, but this should be the least of your concern, you most probably have it already installed. If you don�t want to run the web-server on your own, you can find a hosting company that will host your web-site. This way, you can skip the installation, start writing scripts. There are a lot of hosting companies that offer free hosting services, just search it on the Internet and you�ll find a lot of offers to choose from.
There are two ways of attaching PHP to your web-server. The first and most common way is with using PHP�s direct module interface – also called SAPI – for the most common web-servers: Apache, Microsoft IIS, Netscape and iPlanet. The second way to use PHP is as a CGI processor, which means that you must set up the server to use the command line executable of PHP, so it can process the PHP file requests on the server. This method mostly applies to the web-servers that PHP doesn�t have a direct module interface for.
PHP has installation instructions for both ways. Before installing, you should always make sure that you are logged into the system as the root user (administrator). If you�re not allowed to access the system�s root account, you should ask your system administrator to install PHP for you.
The first way of installing PHP and the easiest way to get PHP up and running is by using a direct module interface. This will require some configuring in your web-server; for example, Apache requires you to edit its configuration file and add a few new entries. In order to find out exactly what you need to do in order to properly install PHP on Apache, or any other web-server, you should read PHP�s documentation.
The second way of installing PHP is not always recommended by the web-server�s developer. Apache calls this method �suicidal�, because, if not configured properly, could allow a user with not-so-good intentions to access some of the web-server�s files which are not intended to be public. So if you�re a beginner, you should stay away from this method of installing PHP. Even advanced users sometimes fail to cover all the security issues.
After you�ve completed the installation, you should remember to take PHP for a test drive, before you start programming. You wouldn�t want to ask people around why your script isn�t working, when the installation wasn�t performed correctly.
From today I want to write about PHP,coz Im learnig PHP.So let’s start…
What is PHP
The endless possibilities of the PHP scripting language and a great community of users has made it one of the most popular open-source languages. For all you people living outside the UNIX world, Open Source means it doesn�t cost anything. You can use it as much as you want and where you want, and nobody will ever charge you thousands of dollars for licenses and support. Even though it was originally conceived as a set of macros to help coders maintain personal home pages, its name grew a lot more from its purpose. Since then, PHP�s capabilities have been extended, taking it beyond a set of utilities to a full-featured programming language, capable of managing huge database-driven online environments.
PHP is now officially known as “PHP: HyperText Preprocessor”. It is a server-side scripting language usually written in an HTML context. Unlike an ordinary HTML page, a PHP script is not sent directly to a client by the server; instead, it is parsed by the PHP binary or module, which is server-side installed. HTML elements in the script are left alone, but PHP code is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers – the possibilities are endless. The output from PHP code is combined with the HTML in the script and the result sent to the user�s web-browser, therefore it can never tell the user weather the web-server uses PHP or not, because all the browser sees is HTML.
PHP’s support for Apache and MySQL further increases its popularity. Apache is now the most-used web-server in the world, and PHP can be compiled as an Apache module. MySQL is a powerful free SQL database, and PHP provides a comprehensive set of functions for working with it. The combination of Apache, MySQL and PHP is all but unbeatable.
That doesn�t mean that PHP cannot work in other environments or with other tools. In fact, PHP supports an extensive list of databases and web-servers. The rise in popularity of PHP has coincided with a change of approach in web-publishing. While in the mid-1990s it was ok to build sites, even relatively large sites, with hundreds of individual hard-coded HTML pages, today�s webmasters are making the most of the power of databases to manage their content more effectively and to personalize their sites according to individual user preferences.
There are some indisputable great reasons to work with PHP. As an open source product, PHP is well supported by a talented production team and a committed user community. Furthermore, PHP can be run on all the major operating systems with most servers.
The speed of development is also important. Because PHP allows you to separate HTML code from scripted elements, you will notice a significant decrease in development time on many projects. In many instances, you will be able to separate the coding stage of a project from the design and build stages. Not only can this make life easier for you as a programmer, but it also can remove obstacles that stand in the way of effective and flexible design.
Well-maintained open source projects offer users additional benefits. You benefit from an accessible and committed community who offer a wealth of experience in the subject, as fast and as cheap as possible. Chances are that any problem you encounter in your coding can be answered swiftly and easily with a little research. If that fails, a question sent to a mailing list or forum can have an intelligent, authoritative response. You also can be sure that bugs will be addressed as they are found, and that new features will be made available as the need is defined. You will not have to wait for the next commercial release before taking advantage of improvements, and there is no hidden interest in a particular server product or operating system. You are free to make choices that suit your needs or those of your clients and incorporate whatever components you want.