Thursday, January 29, 2009

Fiat Chooses PHP and Zend to build and web-enable their Fiatlink system

Fiat Group SpA is a diversified global company in business for over a century and is one of the top fifteen automobile manufacturers in the world, even larger than Daimler AG. Producing more than 85% of the automobiles that the Fiat Group manufactures and sells, the Fiat Group Automobiles SpA (FGA) subsidiary produces about 1.98 million automobiles/year. Over 42,000 Fiat users channel over $30 Billion (USD) in revenue (24 billion euros) through their PHP-based Fiatlink system which is now the primary access point for all of FGA's dealers and service centers to enter car orders and access information across the Fiat Auto enterprise. This is business-critical PHP


“At the beginning we also considered Java as a development solution & language” says Roberto Fileni, Fiatlink’s Technical Architect, “but the main project goals were quick implementation and the PHP learning curve is much easier than with Java. In addition, Fiat Group’s IT division has a solid open-source technologies background. That also helped drive the choice for PHP.”

Conclusion given by FIAT LINK System

PHP is an ideal solution for large, modern enterprises looking to rapidly deploy new and added functionality for their users. Adopting an open-source solution like PHP strategically knowing that in addition to the vibrant open-source community, Zend Technologies is also standing behind the platform provides peace-of-mind when utilizing open-source technology with lower TCO. Supporting tools like the Zend Studio IDE, the Zend application server and more, plus global services consulting and training from Zend's professional services experts all add up to make PHP more than ready for enterprise solutions.

Fiat link is widely considered one of the most important PHP projects implemented to date in Italy and is considered a model for integrating heterogeneous applications and systems quickly and at a lower cost than competing solutions.

Leia Mais…

Tuesday, January 27, 2009

Understanding PHP error messages

Most important thing you need to know about before savoring the delights of PHP:

Error messages.

They’re an unfortunate fact of life, but it helps a great deal if you understand
what they’re trying to tell you. The following illustration shows the structure of a typical error message

Parse error: Syntax error, unexpected T_ECHO in c:\htdocs\testproject\test.php on line 15

Here

Parse error : resembles severity of error

unexpected : resembles what went wrong

File path : resembles where it went wrong

The first thing to realize about PHP error messages is that they report the line where PHP discovered a problem. Most newcomers—quite naturally—assume that’s where they’ve got to look for their mistake. Wrong . . . (Error messages
always prefix PHP elements with T_, which stands for token. Just ignore it.)

Instead of worrying what might be wrong with the echo command (probably nothing),
start working backward, looking for anything that might be missing. Usually, it’s a semicolon or closing quote on a previous line.

There are four main categories of error, presented here in descending order of importance:

Fatal error: Any XHTML output preceding the error will be displayed, but once the error is encountered—as the name suggests—everything else is killed stone dead. A fatal error is normally caused by referring to a nonexistent file or function.

Parse error: This means there’s a mistake in your code, such as mismatched quotes, or a missing semicolon or closing brace. Like a fatal error, it stops the script in its tracks and doesn’t even allow any XHTML output to be displayed.

Warning: This alerts you to a serious problem, such as a missing include file. However, the error is not serious enough to prevent the rest of the script from being executed.

Notice: This advises you about relatively minor issues, such as the use of deprecated code or a non declared variable. Although this type of error won’t stop your page from displaying (and you can turn off the display of notices), you should always try to eliminate them. Any error is a threat to your output.

There is a fifth type of error: strict, which was introduced in PHP 5.0.0, mainly for the benefit of advanced developers. Strict error messages warn you about the use of deprecated code or techniques that aren’t recommended.

Leia Mais…

Saturday, January 24, 2009

Server Information in PHP

In Php $_SERVER array contains a lot of useful informatiom from the webserver. For CGI specification infomation comes from the environment variables

Here is the list of entries in $_SERVER that comes from CGI

1. SERVER_SOFTWARE: A string that identifies the server.

2. SERVER_NAME: The host name, DNS alias, or IP Address for self referencing URL ex(www.php.com)

3. GATEWAY_INTERFACE: The version of the CGI standard being followed(e.g. CGI 1.1)

4. SERVER_PROTOCOL: The name and revision of the requested protocol(e.g. HTTP/1.1)

5. SERVER_PORT: The server port number to which the request was sent(e.g 80 or 85)

6. REQUEST_METHOD: The method the client used to fetch the document(e.g. GET)

7. PATH_INFO: Extra path elements given by the client(e.g. list/users)

8. PATH_TRANSLATED: The value of PATH_INFO, translated by the server into a filename (e.g home/httpd/htdocs/list/users)

9. SCRIPT_NAME: The URL Path of the current page, which is useful for self-referencing scripts (e.g /foldername/filename.php)

10. QUERY_STRING: Everything after the ? in the URL(e.g filename.php?filename=test)

11. REMOTE_ADDR: A string containg the IP address of the machine that requested this page (e.g 192.168.1.100)

Leia Mais…

Thursday, January 22, 2009

Including code from other files

The ability to include code from other files is a core part of PHP. All that’s necessary is to
use one of PHP’s include commands and tell the server where to find the file.

PHP has four commands that can be used to include code from an external file, namely:
include()
include_once()
require()
require_once()

They all do basically the same thing, so why have four?

include() is the only command you need. The fundamental difference is that
include() attempts to continue processing a script, even if the include file is missing,
whereas require() is used in the sense of mandatory: if the file is missing, the PHP
engine stops processing and throws a fatal error.

The purpose of include_once() and require_once() is to ensure that the external file doesn’t reset any variables that may have been assigned a new value elsewhere. Since you normally include an external file only once in a script, these commands are rarely necessary. However, using them does no harm.

PHP’s built-in superglobal arrays

The main superglobal arrays

$_POST: This contains values sent through the post method. where you'll use it to send the content of an online feedback form by email to your inbox.
$_GET: This contains values sent through a URL query string. You'll use it frequently to pass information to a database.
$_SERVER: This contains information stored by the web server, such as filename,
pathname, hostname, etc.
$_FILES: This contains details of file uploads
$_SESSION: This stores information that you want to preserve so that it's available to other pages. It's used to create a simple login system

Leia Mais…

Creating loops

As the name suggests, a loop is a section of code that is repeated over and over again until a certain condition is met. Loops are often controlled by setting a variable to count the number of iterations. By increasing the variable by one each time, the loop comes to a halt when the variable gets to a preset number. The other way loops are controlled is by running through each item of an array. When there are no more items to process, the loop stops. Loops frequently contain conditional statements, so although they’re very simple in structure,they can be used to create code that processes data in often sophisticated ways.


Loops using while and do... while
The simplest type of loop is called a while loop. Its basic structure looks like this:
while (condition is true) {
do something
}
The following code displays every number from 1 through 100 in a browser (you can test it in while.php in the download files for this chapter). It begins by setting a variable ($i)
to 1, and then using the variable as a counter to control the loop, as well as display the
current number onscreen.
$i = 1; // set counter
while ($i <= 100) {
echo "$i "; $i++; // increase counter by

1 } A variation of the while loop uses the keyword do and follows this basic pattern:
do { code to be executed }
while (condition to be tested);

The only difference between a do... while loop and a while loop is that the code within the do block is executed at least once, even if the condition is never true.

The following code (in dowhile.php) displays the value of $i once, even though it’s greater than the maximum expected.

$i = 1000;
do {
echo "$i ";
$i++; // increase counter by 1
} while ($i <= 100);

The danger with while and do... while loops is forgetting to set a condition that brings the loop to an end, or setting an impossible condition. When this happens, you create an infinite loop that either freezes your computer or causes the browser to crash.

The versatile for loop

The for loop is less prone to generating an infinite loop because you are required to declare all the conditions of the loop in the first line.
The for loop uses the following basic pattern:

for (initialize counter; test; increment)
{ code to be executed }

The following code does exactly the same as the previous while loop, displaying every number from 1 to 100 (see forloop.php):

for ($i = 1; $i <= 100; $i++)
{ echo "$i "; }

The three expressions inside the parentheses control the action of the loop (note that they are separated by semicolons, not commas):

The first expression shows the starting point. You can use any variable you like, but the convention is to use $i. When more than one counter is needed, $j and $k are frequently used.

The second expression is a test that determines whether the loop should continue to run. This can be a fixed number, a variable, or an expression that calculates a value.

The third expression shows the method of stepping through the loop. Most of the time, you will want to go through a loop one step at a time, so using the increment (++) or decrement (--) operator is convenient.

There is nothing stopping you from using bigger steps. For instance, replacing $i++ with $i+=10 in the previous example would display 1, 11, 21, 31, and so on.

Looping through arrays with foreach


The final type of loop in PHP is used exclusively with arrays. It takes two forms, both of which use temporary variables to handle each array element. If you only need to do something with the value of each array element, the foreach loop takes the following form:

foreach (array_name as temporary_variable) {
do something with temporary_variable
}
The following example loops through the $shoppingList array
and displays the name of each item, as shown in the screenshot
(see shopping_list.php):
$shoppingList = array('wine', 'fish', ➥
'bread', 'grapes', 'cheese');
foreach ($shoppingList as $item) {
echo $item.'
';
}
Although the preceding example uses an indexed array, you can also use it with an associative array. However, the alternative form of the foreach loop is of more use with associative arrays, because it gives access to both the key and value of each array element. It takes this slightly different form:

foreach (array_name as key_variable => value_variable) {
do something with key_variable and value_variable
}


This next example uses the $book associative array from the “Creating arrays” section earlier and incorporates the key and value of each element into a simple string, as shown in the screenshot (see book.php):

foreach ($book as $key => $value) {
echo "The value of $key is $value
";
}


Breaking out of a loop

To bring a loop prematurely to an end when a certain condition is met, insert the break keyword inside a conditional statement. As soon as the script encounters break, it exits the loop. To skip an iteration of the loop when a certain condition is met, use the continue keyword. Instead of exiting, it returns to the top of the loop and executes the next iteration.

Leia Mais…

Thursday, January 15, 2009

PHP Editors available

These are the following Php editors:

1. Dev-PHP : Dev-PHP is a full-featured integrated development environment (IDE), which is able to create scripts and applications using the PHP scripting language and the PHP-GTK library (both included in the "PHP Package"). No longer in active development.

2. Davor's PHP Editor : Windows IDE configured for HTML and PHP files. Creates and maintain projects as group of files and configures them to run on a local http server. Includes syntax highlighting and undo feature. Available in English and Croatian.

3. CoffeeCup : Full HTML editor with PHP syntax highlighting.Commercial,Evaluation available.

4. PHPEclipse : PHPEclipse is an open-source PHP IDE. Built as an Eclipse plugin, it takes advantage of a well-designed, robust and widely used application framework.

5. ZendStudio : It is a php specific development environment written in java. It features code highlighting and auto-completion (you can add your own functions/variables to the auto-complete database), project manager/editor, AND debugging (break points, step in/out/other, watches....) either localy or remotly (using a zend server extension that comes with the software).

6. NuSphere PhpED 5.5 : PhpED is the Integrated Development Environment for PHP (PHP IDE), HTML, CSS, XML, SMARTY, XHTML and other.PHP code folding is supported in the PHP editor, allowing users to expand and collapse different parts of a PHP file to improve readability. Their implementation is configurable, along with virtually every other aspect of their PHP editor, giving you full control over how you want the PHP code folding to work. For example, you can set the color and the placement of the folding mask or even or disable code folding all together. You can also click collapse all, collapse class methods only, collapse functions etc. Speed and productivity are the key, and when you're using the tool, it feels like someone actually counted the number of clicks that their users have to do in the PHP Editor, then agonized to try to reduce that number.

7. Komodo : Komodo 1.1 provides full support for PHP. This support includes syntax highliting, call completion and tips, and debugging. Komodo runs on Windows and Linux, though PHP debugging is not yet available under Linux. The licensing is commercial, but includes a free license for Educational and Non-Profit use.

Leia Mais…

How hard is PHP to use and learn?

PHP isn’t rocket science, but at the same time, don’t expect to become an expert in five minutes. If you’re a design-oriented person, you may find it takes time to get used to the way PHP is written. What I like about it very much is that it’s succinct. For instance, in classic ASP, to display each word of a sentence on a separate line, you have to type out all this:

<%@ Language=VBScript %>
<% Option Explicit %>
<%
Dim strSentence, arrWords, strWord
strSentence = "ASP uses far more code to do the same as PHP"
arrWords = Split(strSentence, " ", -1, 1)
For Each strWord in arrWords
Response.Write(strWord)
Response.Write("
")
Next
%>

In PHP, it’s simply
$sentence = 'ASP uses far more code to do the same as PHP';
$words = explode(' ', $sentence);
foreach ($words as $word) {
echo "$word
";
}
?>

That may not seem a big difference, but the extra typing gets very tiresome over a long script. PHP also makes it easy to recognize variables, because they always begin with $.Most of the functions have very intuitive names. For example, mysql_connect() connects you to a MySQL database. Even when the names look strange at first sight, you can often work out where they came from. In the preceding example, explode() “blows apart” text and converts it into an array of its component parts.

Perhaps the biggest shock to newcomers is that PHP is far less tolerant of mistakes than browsers are with XHTML. If you omit a closing tag in XHTML, most browsers will still render the page. If you omit a closing quote, semicolon, or brace in PHP, you’ll get an uncompromising error message.This isn’t just a feature of PHP, but
of all server-side technologies, including ASP, ASP.NET, and ColdFusion. It’s why you need to have a reasonable understanding of XHTML and CSS before embarking on PHP. If the underlying structure of your web pages is shaky to start with, your learning curve with PHP will be considerably steeper.

Leia Mais…

Tuesday, January 13, 2009

Php Installation

Many web programmers want to run Apache and PHP on their own computer since it allows them to easily work with their scripts before they put there web application in "live" on the Internet. This post gives a step by step guidelines on how you can install and configure PHP5 to work together with the Apache HTTP Server on Windows.

First get the latest version of Php and Apache software:
You can download XAAPP, which is a open source in which in comes with a bundle like Apache, Mysql , Php , Filezilla.

Downloadable Links

Windows:
Windows Installation


Linux :
Linux Installation

Installing The Software:

In the above links we have the .EXE file and the ZIP file.
1. Download the .EXE file and doubleclick on it.
2. Select the folder path where you want to save it(default is program files folder)
3. Click next it automatically installs the Php , Apache , Mysql softwares.
4. Before completing it checks for the port number(available port number default is 80 or 85).
5. If you installation is sucessfull, It prompts with a message (You installation is sucessfull).
6. For testing please type as below.
http://localhost/ -- Default ports.
http://localhost:85/ -- If your port number is 85.

If a page displays describes about the XAMPP then your installation is sucessfull.


Mysql Front-End

When you have Installed XAMPP, Mysql database installed. To get the mysql front end please click the below download link.

Link:    HieldSql

Leia Mais…

Tuesday, January 6, 2009

5 Next Generation PHP Frameworks

There are the 5 forerunners for the next generation of PHP frameworks amoung all the frameworks. Each one of these frameworks has some foreword thinking quality that sets them apart from the PHP frameworks. Many of these are a response to the recent Ruby on Rails, rapid application development hype, and some, like PHP on Trax is a direct port of Ruby on Rails.PHP frameworks is the newest buzz word that is spreading the PHP community due to the threat posed by the famous Ruby on rails

The Five different frameworks are:

Zend Framework : The most hyped framework, Which develops PHP itself. It has just got out of beta. You will also find it is rich with features too. It was also the fastest. No doubt it has all the corporate stuffs but you may felt it’s a bit tough. Just a little too much for most. It doesn’t have PHP 4 too. But it will definitely more provide support and professional code being backed by a corporate company. This framework is mainly used for those who want to build apps for big enterprises. They will have pro coders and will also be benefited from the components it provides.They are also partnered with Ning.com, an online platform for painlessly creating web apps.Zend promises to be the backbone of the next generation of web applications.For more information Click here


Symphony : This framework is the most feature-packed, As it uses separate modules to handle things like a DB layer.Symfony boasts easy AJAX implementation and includes the entire Script.aculo.us suite of Javascript effects.Symfony also has the ability to generate propel CRUD and application scaffolding from an already constructed SQL database. That means it objectifies all the SQL language and makes creating database driven apps easy as pie.For more information click here

Prado : This is the most unique of them all. It is not a “rails clone”. Rather can be said as “ASP.net in PHP”. It provides event based web apps like ASP.net. ASP.net is known as the choice for the big enterprises. This one is still new and obviously not as powerful as ASP.net. But it can be a good lesson for those who are coming from an ASP.net background or want to go there.For more information click here


CakePHP : CakePHP is definitely looking the most promising. It provides all the ease of use of rails yet its speed has gone down. It has a very active community and the difference of this framework from others is, it is actually used by many companies and websites. Even popular CMS mambo has decided to use cake in their next version. Cake’s Object Oriented feature makes easy for anyone who has had OO experience to pick up. Cake is known as rapid application development as well as used on AJAX implementation.For more information click here

CodeIgniter : This framework can be called “the easy CakePHP”. It does not enforce strong MVC pattern like rails or cake. So it is easier to learn for beginners. I also think it is a good candidate for porting existing code as it follows a more traditional php coding style. It also has a very strong community and lots of additional components. It also very fast than most frameworks.For more information click here

Leia Mais…

What is PHP ?

PHP is a scripting language that brings websites to life in the following ways:

  • Sending feedback from your website directly to your mailbox
  • Sending email with attachments
  • Uploading files to a web page
  • Watermarking images
  • Generating thumbnails from larger images
  • Displaying and updating information dynamically
  • Using a database to display and store information
  • Making websites searchable
  • And much more . . .
PHP is easy to learn,it’s platform-neutral, so the same code runs on Windows, Mac OS X,
and Linux; and all the software you need to develop with PHP is open source and therefore
free.

PHP started out as Personal Home Page in 1995, but it was decided to change the name a couple of years later, as it was felt that Personal Home Page sounded like something for hobbyists, and didn’t do justice to the range of sophisticated features that had been added. Since then, PHP has developed even further, adding extensive support for objectoriented programming (OOP) in PHP 5. One of the language’s great attractions, though, is that it remains true to its roots. You can start writing useful scripts very quickly without the need to learn lots of theory, yet be confident in the knowledge that you’re using a technology
with the capability to develop industrial-strength applications. Although PHP supports OOP, it’s not an object-oriented language, and the scripts in this book concentrate on simpler techniques that are quick and easy to implement. If they help you to achieve what you want, great; if they inspire you to take your knowledge of PHP to the next level,even better.

Make no mistake, though. Using simple techniques doesn’t mean the solutions you’ll find in these pages aren’t powerful. They are.

Leia Mais…

Why me?

Arthur Ashe, the legendary Wimbledon player was dying of AIDS which he got due to infected blood he received during a heart surgery in 1983. From world over, he received letters from his fans, one of which conveyed: "Why does GOD have to select you for such a bad disease"?

To this Arthur Ashe replied: The world over -- 5 crore children start playing tennis, 50 lakh learn to play tennis, 5 lakh learn professional tennis, 50,000 come to the circuit, 5000 reach the grand slam, 50 reach Wimbledon, 4 to semi final, 2 to the finals, When I was holding a cup I never asked GOD "Why me?".

And today in pain I should not be asking GOD "Why me?"

--------------------------------------------------------- Jagdish Mamidi

Leia Mais…

Monday, January 5, 2009

New York fully wireless

ame across this article on Neowin, imagine this happening in South Africa?? “New York City is preparing to go fully wireless by January, 2005. The deal is currently being finalized between New York City authorities and six technology companies. To strengthen coverage and signal, 18,000 new lamp post-based antennas will be installed virtually everywhere in the five burroughs that make up New York City.“

-------- Article taken from http://dotnet.org.za/davidb/archive/2008/12/21/3500.aspx

Leia Mais…

The three biggest mistakes that website writers make

If I walk into a retail shop, I want the clerk to smile at me and look approachable. Similarly, if I let my fingers walk into a website, I want to feel welcome. Here are the three biggest mistakes that website writers make. (Note: the examples below are not manufactured -– they’re from real websites ):

Using language that’s too formal: “Government spending is a major economic driver that has a tangible impact on the economic well-being of every business and individual,” reads one typically pompous site. Doesn’t the writer sound like he’s wearing a smoking jacket and holding a glass of brandy in the other hand? I like websites where the writers “talk” like ordinary people.

‘Selling’ too fast: If I walk into a store and the sales clerk greets me with: “What would you like to buy today?” I tend to run fast – in the opposite direction. Don’t you? But many websites are just as bad about leaning in for the kill too quickly. “Get the best deals around on computers,” screams one home-page headline. And it doesn’t let up with the subheads: “Whether you are looking for refurbished, used, brand-new, laptop, desktop, large-screen, multimedia-centric, there's the perfect computer for you out there,” it continues. Fair enough. But I’d like to feel comfortable and get the lay of the land, before I get mowed down by the sales pitch.

Focusing on me-me-me: Don’t you get tired of the cocktail party bore who can talk only about himself, his job, his kids, his neighbors? Ever noticed how many websites are similarly narcissistic? “We are continuously working to improve our products,” says one. Well, good for you, I say. But if you want my business, let’s stop the focus on you and talk about me for a change.

The words you choose for web writing are important.. Talk to me in warm, simple language. Don’t sell too soon. And talk about MY issues (not yours.)

Then, and only then, I might be in the mood to buy.

Leia Mais…

Sunday, January 4, 2009

Welcome to Your solutions

HI All,

This is the new blog which lists all the solutions needed for you, Or you may require to know.

Feel free to post my your queries.

Thanks

Leia Mais…