Showing Date With PHP

Wanting to learn how to display the time / date on your webpage, I will show you how with this fast and easy PHP Tutorial, this tutorial is very basic and should be extremely easy to implement.

Heres an example of how to display the date and time like: Fri May 13, 2005 12:01:21 (or whatever the date and time is currently)

Read More on How to show Date with PHP

Password Protection with PHP, MySQL, and Session Variables

One of the great promises that actually came true when our Internet-enabled world reached the twenty-first century is efficient customer-to-business interaction. Each day, I find a new way to go through life’s errands without ever waiting on hold for a bank teller, a pharmacist, or an insurance agent. I do it all online.

Internet savvy consumers are coming to expect such web empowerment. And while these information transactions usually require some sort of private data traveling the ether, you, as the webmaster, bear the burden of keeping that data away from those who have no right to it.

Since retina scans and brain wave signatures are still properties of James Bond flicks, we’re stuck using plain old boring passwords.

Is this really secure?

Read full Article

PHP Web development Advantages

Advantages of the PHP Web development services:


• Low development and maintenance cost

• High performance and reliability

• Ability to embed itself into the HTML code

• Compatible with servers like Apache and IIS

• Low execution, maintenance and debugging costs.

• Runs on Apache web server, and in turn Apache runs on Windows, Linux, Solaris, and various other Unix platforms, so whatever server investments have been made, can be utilized .

• Utilization of various open source applications and pre-packaged PHP modules during application development saves round 30% - 40% of the development time.

• PHP is Open Source. Open Source means you never need to rely on the manufacturer to release the next version if something doesn’t work or pay for expensive upgrades.

• PHP is also endowed with other goodies, like native support for many popular. databases, an extensible architecture, and a processor that not only uses fewer resources on the server than many of its competitors, but also displays pages in record time.


Read more Advantages of PHP Web Development

Choosing PHP as Web Development Languages

PHP is a powerful server-side scripting language for creating dynamic and interactive websites. PHP is an easy and user friendly language. Developer with sound knowledge of html an having little bit programming skill can easily create their own web pages. PHP can be easily embedded into HTML Pages and completely suitable for Web development. PHP is often used together with Apache (web server) on various operating systems. PHP is an open sources language. Suppose you wanted to create a survey to collect information from visitors to your web site.

For example you have a food supply store that sells tea, coffee, and biscuits. To gather order information from our customers we will have to make a page with an HTML form to gather the customer's order. Using an associative we can get this information from the $_POST associative array. PHP is also used to send secure mails and to collect information from contact form and other link exchange forms. In the recent years many developer has started using PHP as an open sources languages. PHP is stands for PHP Hypertext Preprocessor, is a server-side embedded scripting language. When a page is requested that contains PHP, the processor translates and executes all the commands in the page, and then outputs the result to the browser as regular HTML. Resembling other scripting languages, like ASP, PHP can be embedded directly into HTML. A Start and end entry separates PHP from HTML. There is no secret that there are other languages too like ASP, Perl, Cold Fusion that are the alternatives to PHP. But each of these languages have complexity and differences in syntax and structure. Here are the few advantages of using PHP are:

Read Full Article

PHP and Cookies; a Good Mix!

Introduction

Cookies have long been used in PHP scripts, and are a very useful function. But what exactly are cookies? Maybe you have used then, but you still don't know exactly what they are. Or you are completely new to cookies? It doesn't matter, because in this tutorial I will show you exactly what cookies are, and what they are used for.

Cookies in a nutshell

Cookies are small pieces of information that is stored on the computer of your visitors. Each browser handles it differently, but most simply store the information in a small text file. Internet Explorer has a special folder, which can be found in your C:\Windows or C:\Windows\System32 folder. You can delete all your cookies, by going to the Options and 'Clearing Cookies' or deleting them by hand. I don't recommend this though.

Almost every website uses cookies. If you go to Amazon.com, you will get several cookies. The same goes for CNN.com. Even Google uses cookies! They are extremely useful for (temporarily) storing information. For example, if you have a login system for your visitors, you could save their userid and password (very heavily encrypted!) so they are automatically logged in the next time they visit your website.

Or you could remember their last visit, and highlight everything that is new. And that's just the beginning.

Using Cookies

Using cookies in PHP is extremely easy. In fact, there is nothing to it, because of PHP's inbuilt setcookie() function (http://php.net/setcookie). Have a look at the documentation, and then try the following example:

Read Full Article

PHP Nuke Themes: For a New Look and Feel

MYSQL database supports PHP scripting Language. The web based automated news publishing and content management system is provided by PHP nuke. It is a open source software which is released under a GUI interface. It allows the free downloading and installation. By this software you can create a web blog or use it just as a CMS. It also allows the editors to eas Content Management System, post contents and create comments threads.


There is an advantages of PHP Nuke is, it is a open source project, because PHP Nuke is an open source, which is a large community of developers who work on

PHP Nuke. In additional to that flow of free PHP Nuke modules, free PHP Nuke Add-ons and free PHP Nuke template never appear to end. Ta PHP Nuke

Read full Article on PHP Nuke Themes

Get PHP pages indexed in the Search engines

A simple method to convert files from Php to Html Extensions, on an Apache Server

Most will agree Php has become the common language for creating dynamic Websites. Although the language is simple and efficient, developers are finding trouble getting traffic to their Php site. It is believed by many educated Search Engine Optimization Specialists that spiders do not read beyond the, “.php,” on a URL. Therefore, dynamic pages that pass a variable will be overlooked. For example, on a PHP directory, variables may be passed to a file as, “index.php?category=x”. In this instance, the category specified as “x” will not be read or indexed by Search Engines. Spiders will open the parent page (index.php). This is supported by the belief that nothing is read beyond the “?”, thus making all category links, “index.php”.

While many dynamic Websites still receive modest traffic, it may be in a developers’ best interest to allow some, or all, dynamic pages to be seen as well. Having two pages indexed may not double a sites’ traffic, but it will ensure a noticeable increase. Developers’ can easily overcome this problem, if their Site resides on an Apache Server.

This simple fix will satisfy the problem for a simple script, as in the example above, where one or more Php files are passed variables to perform different functions. Bare in mind, if a Php file only performs one task, this is not required. Files that perform a task without the “?variable=x” being required will be indexed. Therefore, it would be useless to transform them to a Static URL (HTML File).

Identify the Php File Needing to be changed to an Html

First, identify the desired file, or files, that require the change, along with the variables that generate a common page. Generally, this may be, “index.php”. To help readers follow along, I am going to utilize the above Directory example. On our Directory program, we have a main page, “index.php,” which always displays links to Subdirectories. The subdirectories are opened by passing a variable to the index file. For example, a subcategory called, “Arts and Crafts,” is displayed with, “index.php?category=1”. Additional subcategories are displayed with an identical syntax, but the end variable changes. Because of this, we need to modify the way our server opens the index.php file, when a variable is attached.

Next, we need to place a simple .htaccess file in the directory where, “index.php,” is located on the server. The .htaccess file is a simple text file that we name .htaccess. Vdeck users may need to create a file named something.txt, and then rename the file to .htaccess, from the admin panel. Now we need to specify some variables to the server. For this example, I am going to change the, “?category=x,” variable to, “directory-x.html”. This step will eliminate our problem of having the subcategories noticed by Search Engine Spiders.

To start our server variables, we need to create a rewrite engine in the .htaccess file. Simply put our first line will read, “RewriteEngine On”. This tells the server we are changing the way certain files are to be handled. No we need to specify our Rewrite rule. On the next line, “RewriteRule ^directory-([0-9]*).* index.php?category=$1 [L,NC],”. This is delegating, “requests to this directory, where the file is named, “directory-,” followed by a range of 0 to 9, followed by anything (* = Wildcard) and, “dot,” anything (* = Wildcard), we are going to display, “index.php,” file with the variable attached. We can create another rewrite rule on another line of our .htaccess file. However, a meticulous developer likes to test things out before making changes to the actual Php file, or progressing ahead of oneself. We can test our, “RewriteRule,” by opening another browser window and entering, “directory-1.htm or directory-1.html,” into the address bar. We should see the same page displayed as, “index.php?category=1,” is called.

Read Full Article

For Automated Sites PHP and MySQL are A Perfect Match

You’ve decided to automate your web site. Now what? Here are some ideas to help you choose how to automate your site.

A bit of programming is going to be necessary if you want to automate a site. There are many types of programs that can be used to automate a web site including JavaScript, PHP, Perl, ASP, Java and more. So, which do you use? For many, it is a personal choice.

I prefer PHP for programming. PHP is a particularly useful programming language because it allows for advanced programming and is easy to integrate with web pages. Another plus of PHP is that the language interfaces very well with MySQL, a popular type of online database.

Yet another plus of PHP is that it is Open Source Code. The actual code that is PHP is available to the public for free, while the source code for products such as ASP are not. Because PHP is open source, there is a large community of PHP programmers that help each other with code. This means PHP programmers can rely on each other by using reusable pieces of code called functions and classes rather than constantly reinventing the wheel. This can dramatically cut down on production time.

Overall, PHP is flexible, cheaper than many alternatives, and built around a community. PHP and MySQL are excellent choice for webmasters looking to automate their web sites.

Read full Article

Facts about PHP Programming Language

PHP which is officially known as ‘Hypertext Preprocessor’ was released in the year 1995. Initially written as a set of Common Gateway Interface (CGI) in ‘C’, PHP was originally designed to replace a set of Perl scripts to maintain his Personal Home Pages (also known as PHP). PHP was originally designed to create dynamic and more interactive web pages. It is the most widely-used, open-source and general-purpose scripting language. It is a server-side scripting language often written in a HTML context. PHP code in a script can query databases, create images, read and write files and talk to remote servers. The output from PHP code is combined with HTML in script and the result is sent to the user.

It is possible to use PHP in almost every operating system. PHP can be used in all major operating systems including Linux, Microsoft Windows, Mac OS X, and RISC OS. PHP uses procedural programming or object oriented programming and also a mixture of them. PHP is used mainly in server-side scripting, command line interface and writing desktop applications. PHP also supports ODBC, the Open Database Connection standard which allows you to connect to other databases supporting this world standard. Server-side scripting is the most traditional one for PHP development. In order to use PHP for server-side scripting you need a PHP parser, a web server and a web browser. The PHP codes entered with the parser on a web server will be translated into a PHP page that can be viewed on your web browser.

PHP is a popular language because it can be embedded directly into HTML coding. It has more benefits such as the following - it can be used on all major operating systems and can be supported by most of the web servers. The latest version of PHP development is a very stable and grown-up language used for web programming like Java and Microsoft C#. Both the PHP engine and the PHP code can be used on any platform, which makes PHP extremely flexible.

PHP has many features designed specifically for use in websites. PHP can be used to make your website secure by implementing mandatory sign in feature – asking the user or the administrator to enter a valid username and password. Adding such a feature is easy as PHP can display a HTML form and process the information that the user types in. This ‘sign in’ feature can be an excellent way of getting to know about your customer’s profile.

Read Full Article

5 Easy Tips for Faster PHP Development

PHP development along with MySQL development has become one of the most popular web development services over the Internet today. With rapid updates and secure changes being made in the PHP development scene, it is bound to become one of the commanding scripting languages in no time. In custom web development services time is more important, with web development experts being constantly on the lookout for better tools to enhance speed in PHP development.

Here we shall discuss the five most effective tools to speed up PHP development for better results.

1.A superior editor or an IDE – Are you still using editing tools like Notepad or WordPad? Then its time to change to better alternatives, such as EditPlus2 or PHPEdit, which are absolutely free. A better editor gives you time-saving advantages such as - Color highlighting, hence easier spotting and correction operations. Search, locate and replace operations. Another way is to use an extensive IDE (Integrated Development Environment), though these come with a high stake of license fees.

2.Use a basic relevant framework – Most PHP development projects are built on a similar kind of framework. Therefore, instead of starting off from square one on every project, use the skeletal framework and build on it, thus saving oodles of time on your project, which you can actually use to troubleshoot or customize your project better!

3.Recycle and Re-use – Ready solutions and answers to questions or issues that have risen and solved in previous projects should be put to use. Most of the existing scripts not only provide great ideas to imitate, they are free too! Extending an existing PHP script for custom web development services or modifying it to suit your needs will save you a lot of time and money.

Read Full Article

Secure PHP Programming

Writing insecure code is easy. Everybody does it. Sometimes we do it accidentally because we don’t realize that the security issue exists, and sometimes we do it on purpose because we suspect the bad guys won’t notice one little vulnerability. Secure programming is often overlooked because of ignorance, time constraints, or any number of other factors. Since security isn’t flashy until something goes wrong, it is often easy put it off.

Once your application is compromised, you will realize there’s nothing more important. The best case scenario is that you lose days of productivity and suffer downtime while you fix what was damaged. The worst case scenario &em; your data is compromised and you have no idea if it is correct, much less what the hackers managed to copy and read. Did you expose usernames and passwords to the world? Did you happen to release the credit card information for thousands into the den of identity thieves? You’ll never really be able to know. It’s best to practice secure programming so you never need to ask yourself these questions.

With this in mind, let’s examine three different classes of secure programming "no-noes," storage risks, system risks, and exposure risks and discuss how we can prevent each of them. Server configuration and data transmission security are beyond the scope of this article, but the reader should be aware that they also play a major role in securing a web application.

Storage risks are those risks involved in the storing data and interacting with a database server or file system. The most widely known of these in the infamous SQL injection attack. SQL injection is when you allow the user to input data into a query, and instead of a value he adds his own SQL into the query. The easiest way to prevent this type of attack is to escape every user variable that could touch your queries. Luckily, PHP has several build in functions for handling this, such as mysql_escape_string(). Essentially, this works by escaping characters in a string that could conceivably be used to terminate your query and run a user specified query.

When should you escape user data? It all depends on who you talk to. Some programmers prefer to escape as soon as it enters the application, while others prefer to wait until just before it is placed into the query. Personally, I prefer to escape right before it is inserted into the query. I do this because I can always look at the code, see the database interaction, and see that the data was escaped before it was being used. I don’t need to search the entire source to make sure something was escaped.

The second storage risk we’ll talk about is storing passwords as plain text (hereafter referred to as clear text). I know you guys do it; I’ve seen too many open source applications and too many in-house applications to believe that it doesn’t go on. Simply put, there is never any reason to store a password in clear text. It doesn’t matter if you’re storing the password in a database or a flat file, always store passwords as a hash. You can accomplish this simply enough by using PHP’s md5() function to transform the password before you insert it into your storage medium. Since md5 is repeatable, you can validate a password by simply using

When should you transform the password to a hash? You should do it as soon as possible. Don’t let the password variable float around your application at all. As soon as you grab the password input, convert it into a hash. I prefer to do this by setting the password variable to its own hash, this avoids the chance of using the wrong variable in later code.

Next, let’s talk about the usernames and passwords your program needs in order to interact with other applications (like database servers). You should always separate these out into a different PHP file than the rest of your code, and reference them as constants or variables. This not only makes your code easier to maintain (if you need to change a password, you know exactly where to look), it the event that your source gets released, you know that the password isn’t in that file. While it’s certainly true that they could grab your password file, it does reduce the risk considerably.

Before we leave usernames behind, I want to touch on the concept of division of power. We’re not talking about the government in this case, but about database users. The database user accounts your program uses should have the minimum level of access they need in order to function correctly.

If your application only reads from a database, then the database account it uses should only have SELECT permission on that particular database, and no access to any other database.

To take this concept a step further, I prefer to create multiple database accounts for my web applications. Typically I create one account that only has INSERT permissions for the particular tables the software needs to write to, and a completely separate account that only has SELECT access. This makes sure that no INSERT queries are accidentally performed and mitigates the possible damage done by SQL injections.

Of course, multiple accounts work best when there’s a clear separation between those who can write to a database and those who can read it (such as a CMS). In theory, you could use multiple accounts in any application but you run into problems with the number of open connections to the database. This is simply something that should be considered as a possibility during the design phase of your software.

I’m a big advocate, as are most programmers, of breaking source code down into multiple files at every logical opportunity. However, I’ve noticed that a lot of PHP programmers have a nasty habit of naming PHP files they intend to use as libraries or other include types with the extension .inc, or .config, or some other non .php extension. This is a horrible idea because the server its running on might not be setup to parse these extensions as PHP files, so anyone loading the file would be exposing their source code (and potentially passwords, usernames, and other protected information) to the world. I prefer to prefix filenames myself, using inc_ or class_ when needed.

While we’re discussing included files, I would like to talk about to other security precautions. If you have a PHP file that you intend to use only as part of a larger PHP application, add this line to the beginning of the file (__FILE__, $_SERVER['PHP_SELF']).

This will cause the file to immediately terminate is someone tries to run it directly. A well written include or class file shouldn’t do anything when loaded on its own, but you can never be too careful &em; especially when a one line cut and paste can potentially save you so much heartache.

The other include-related item I’d like to talk about is the difference between include() and readfile(). Include will tell the server to parse the file as PHP, while readfile tells the server to output the file as straight text. You should never use include on a file that is publicly writable (for example, if you have an application that appends user submitted data to end in order to simulate a graffiti wall or guest book) or on a file that you don’t control (files on other servers, or that others can edit). A malicious user could easily inject his own PHP into your system, causing untold amounts of havoc. At the same time, you should never execute readfile on a file that ends in .php. On a misconfigured system, this runs the risk of exposing your source code to the world. To summarize, use readfile() on html, txt, and remote files. Use include on local files with php code you want to execute.

Now let’s talk about system risks. I think of system risks as those things related to the way code executes. The primary system risk in any application is invalid data. You can never valid data enough. As soon as user data enters the system, you should immediately verify it exists and that it is what you want it to be, if not your program should halt and prompt the user for better input.

When validating data, you should use the tightest filter possible. For example, if your program is expecting a percentage, you should not simply verify that they entered something. Your program should verify that it is numeric and between 0 and 100.

You should also validate at every level. Every time a function accepts input, verify that the data is what you expected it to be and react accordingly if the data is bad. This will make it more likely that you will catch bad data due a programming oversight, it also has the added advantage of catching logic errors in your software.

Next, I’d like to talk about eval(), exec(), and their ilk (shell_exec(),system(), passthru(), and pcntl-exec()). Visit their respective php pages to find out more about them, but in actuality there is very rarely any reason to use them. Eval will run any php code passed to it as a variable. This is inherently dangerous because you no longer have absolute control over what code is executed. If you must use eval(), don’t ever run it with a variable that has been derived from a user determined value, otherwise you run the risk of a hacker injecting his code. Exec() and the like pose similar threats, allowing your script to interact with the command line is a level of power you should rarely, if ever, need.

Finally, let’s talk about a couple of exposure risks. Usually, you don’t want to show your error messages to the world. For one, they freak people out. Secondly, they give hackers a wealth of information about potential bugs in your code. On production systems, always turn your error reporting off and use PHP’s errorlog() function instead.

The last risk we’ll talk about is using session IDs. Simply put, try not to ever send the session id to the user. Sessions aren’t secure, but if you transmit the session ID you run an even greater risk of someone other than the expected user to act as a "man in the middle" (to steal an analogy) and piggy-back off of the legitimate user’s session. An example of this would be using a session id to hijack someone’s shopping cart and change a delivery address, get credit card information, or do something even more malicious depending on the system.

Read more about Secure PHP Programming

PHP Programming Made Easy

It is also very important to note that if you really want your program to operate, follow instructions to the letter. With this type of system, accuracy is the key.

Contrary to common notion, programming is not really hard, at least at present. Compared to the earlier days of programming about more than twenty years ago when it was totally alien to most people, nowadays, almost anyone can learn this skill. It’s true that during the infant stage of programming there were learning books to assist those who wanted to study and train in this field. However, we are luckier now because there are tutorials, mostly online, that can help us in developing programming skills.

On the other hand though, undergoing tutorials either online or in actual location should be boosted by one’s perseverance and interest. Perseverance requires the learner to read tutorial lessons and later try out some actual programming work while interest pushes the person to really want to acquire and learn said ability.

Blogger is equipped with a superb interface used to tidy up blog entries as well as facilitate endorsement of a blog to attain a better position in its niche. This application only requires an uncomplicated SimpleXML set transported with an entire PHP system, along with some understanding of the Google Blogger API and a small part of PHP scripting to come up with the needed HTML code.

Blogger interface is so excellent that it should be put to full use when promoting a blog because with this method, one need not install blog software on a web server anymore since it is already inbuilt with Blogger. This way the web site owner saves time and effort, plus he is able to maintain his MySQL database allowance and set it aside for better and more advanced use in the future.

Mashup, in technological context, refers to a web application that makes use of a combination or mixture of data from two or more sources. This combination is then put together into one single device. A good example for this is the integration of cartographic data from Google Maps to real-estate facts, thus producing a different and fresh web service which is otherwise not provided by either or both sources. Consequently, the end-product of mashup is data or code that can be applied for software purposes.

Read more about PHP Programming Made Easy

To Create Dynamic Pages Choose An Advance Programming Language Like PHP

PHP is an open sourced server side scripting language and almost used in foremost operating systems like Linux, UNIX and also in Windows. PHP follows object oriented programming (OOPs), practical programming rules and nearly a combination of them. It uses command line interface, desktop applications thus it is know as the best traditional server side scripting language.

PHP programming (http://www.getaprogrammer.com.au/) supports most of the reputed database connections like Oracle, SQL, My SQL, and ODBC thus it is an easy choice for freelance programmers to build their dynamic pages with the help of PHP development. The latest version is also popular because it can be embedded HTML coding directly and can be carried by nearly all of the web servers.

PHP is a popular language because of its numerous features infused specifically to design websites or you can say to develop dynamic pages. PHP engine and the PHP coding can be used in every platform that increases flexibility of PHP language. Basically PHP is profitable for both programmers and designers, programmers who realizing its flexibility and tempo and web designers who worth its handiness and user-friendliness.

PHP language can develop giant business services like CRM solutions, community sites, chatting forums and E-Commerce shopping cart as well. Several pools of qualified web programmers (http://www.webprogrammers.com.au/) are using PHP development for organizing their goal, resource planning and fulfilling their client requirements.

Here are some few things which you can perform with PHP:

• Design HTML web forms.
• Superb Database usability to store records.
• Calculate visitors by sessions and cookies.
• You can use arrays as well.
• Play with files through file management system.
• Creating XML for large number of product list on E-Commerce

Serialization

Serialization is not needed for all kind of databases. In some particular databases like ODBC, MS SQL etc when you wish to pass a value without mentioning its type, it gets dumb. This problem is solved properly in the latest version of PHP. This is also an added advantage of PHP over all king of scripting languages.

Using PHP to Improve Design your website

PHP has many capabilities features designed specifically for use in Web sites, including the following:

1. Securing Your Website: PHP is designed to allow user level access to the file system, it's entirely possible to write a PHP script that will allow you to read system files such as password, modify your Ethernet connections, etc. thus this can provide a customer with an exclusive membership in the business.

2. Working with Web Forms: HTML form can be displayed by PHP and it is the best way to know more about the requirements of your customers and to gather note about their detailed benefits.

Read Full Article

PHP Development Is Becoming Increasingly Popular

PHP can be used on most operating systems, which makes it quite versatile. Whether you use Microsoft Windows, Linux, MAC OS X or a wide variety of other OS’s. PHP also allows you to choose an operating system and web browser that you are most comfortable with. One of the great features of PHP development is that it allows support for almost any kind of database that you could think of.

PHP development is basically referring to an open source scripting language. It’s most common uses are for web development and it can also be imbedded into HTML. Since it is such a versatile form of script writing, it can be used by the beginning programmers as well as the more advanced ones. In only a few hours, you can learn the basics of PHP development so that you can begin to use PHP to your advantage. Also, if you are an experienced programmer, you can utilize some of the more advanced features of PHP in order to capitalize on your potential.

Web development is becoming a more prosperous industry lately. Since the Interet and the computer wave in general is becoming quite lucrative, web development is becoming a booming industry in which everyone wants to be a part. However, it is also a very competitive industry since there are many professionals that are quite adept at programming. Therefore, learning proper PHP development strategies is beneficial. If you already have prior knowledge of computer language and coding, PHP should come as a second nature to you. The fact that is can be used in its most primal forms for basic programming as well as incredibly advanced programming only ads to its possible potential for programmers.

In order to become a succesful web developper, you will need to familiarize yourself with all of the different aspects of computer programming langage. Since this industry is booming more than almost any other industry right now, there are always new languages to learn and new programming developments to enquire about. Although PHP development isn’t all that new, it is quickly becoming the preferred method among many of the high ranking computer programmers. The amount of versatitily that this language gives you combined with its relatively easy learning curve make it a very desirable language to learn.

Read full Article

PHP In A Nutshell

Going back to the definition for a little while, PHP is indeed a server-side scripting language that is typically used in the creation of dynamic Web pages. It is a relatively easy to learn programming language that enables you to feature more dynamic content on your web sites.

PHP is different from other types of programming languages in that it is designed to work in conjunction with HTML. This compatibility is a distinct advantage of PHP and allows you to easily integrate it into web pages that have already been extensively rendered with HTML. This integration is in fact so seamless that you can quite readily switch between the two languages even within the same web document.

How this while thing works is basically like this: web sites are typically designed with a combination of PHP and HTML in varying proportions depending on the designer’s intended purpose. When a visitor points his browser to the web page in question, the server will “read” and subsequently process the PHP instructions and later send the results of the process to the browser of the visitor. This is pretty much similar to how other languages such as ASP or ColdFusion work. The main difference however is that PHP, unlike the aforementioned ASP or ColdFusion, PHP is both an Open Source and a cross-platform application. What this means is that PHP can be run under the Windows NT platform as well as many versions of the UNIX platform. In addition, PHP can be designed to function as an Apache module and even as a binary that can be run as a CGI.

PHP by its very nature is exceptionally light and fast to run but when designed to run as an Apache module it is even more so. The absence of any process creation overhead allows PHP to return results quickly compared with other programming languages plus it has the added benefit of not requiring the tuning of mod_perl in order to limit your server's memory image to a manageably small size.

Beyond its usage as a means to control and alter the contents of your web pages, PHP can also serve to function as an HTTP header sender. It is typically used in this function to set cookies in web browsers, manage the site authentication processes, and to redirect users to other sites. PHP also works well with other programs and applications, enabling unparalleled connectivity with many different databases as well as ODBC, as well as offering seamless integration with many different external libraries; libraries that allow you to accomplish tasks such as publishing PDF documents and even parsing XML.

The way PHP fits within your web pages is extremely elegant in its simplicity; so simple in fact you will not need a special development environment or IDE at all. You merely have to place a at the end. PHP can also be configured to utilize ASP type tags as well as .). The PHP engine is charged with the task of processing everything that is contained within those tags.

If you have had an extensive or even only a little background in programming languages, you may have already noticed that PHP has a lot in common with the languages C and Perl, especially in its language syntax. Just like in C and Perl, you do not have to declare variables prior to you using them, and it is also quite easy to create arrays and hashes (associative arrays).

So much for its characteristics; now how can you use PHP?

Read more about PHP In A Nutshell

Apache, Mysql & Php For Windows

Apache, MysQL and PHP for Windows could be a nice nice thing to have on your Windows workstation. You could try and experiment with all kinds of nice PHP and MySQL based applications right on your Windows desktop running Apache, instead of having to access a full-featured server.

Most people have Windows as their workstation and it can be sometimes difficult to switch to another operating system. So, you may have always wanted to run PHP applications on your Windows machine but wondered if it is too difficult to install or if the hassle will be worth it.

This article gives you the essential information to get started right away. Even if you are a seasoned PHP, MySQL and Apache guru, the checklist below will still be helpful in your installation process.

There are lots of 3rd party software that bundles Apache, MySQL & PHP in one package and installs them on our computer. We do not recommend this and suggest that you directly get Apache, MySQL & PHP from their official sites.

Apache

1. Get Apache 1.3.33 from here: http://httpd.apache.org/download.cgi.

2. Choose a mirror close to you and in the same page, look for the Win32 Binary (Self extracting) file: apache_1.3.33-win32-x86-no_src.exe.

3. Download the file and save it on your hard disk. Run the installer and the self-extracting wizard will guide you through the rest of the steps. Choose all the default settings and run Apache as a service.

4. Remember to put "localhost" when asked for a Server name/Domain name. Use "administrator@localhost" when asked for the administrative email account.

5. Now point your browser to: http://localhost and you should see an Apache Test Page.

6. You can change this page by creating an "index.html" page here "C:\Program Files\Apache Group\Apache\htdocs".

7. You can manually start and stop the Apache server. In a Windows command prompt, type "net stop apache" or "net start apache".


MySQL

1. Get MySQL 4.1.7 from here: http://dev.mysql.com/downloads/mysql/4.1.html

2. Under the Windows downloads section, choose Windows Essentials (x86) and click on the Pick a Mirror link.

3. Download the file mysql-4.1.7-essential-win.msi and save it on your hard disk. Run the installer and the self-extracting wizard will guide you through the rest of the steps. Remember the root password when prompted for it in the installation process.

4. Once the installation is done, on your Windows toolbar, go to "Start->Programs->MySQL->MySQL Server 4.1->MySQL Command Line Client".

5. Type the root password and you should be logged in to the MySQL shell.

6. Type "show databases;" to see the list of databases. Type "quit" when you are done.


PHP

1. Get PHP 4.3.10 from here: http://www.php.net/downloads.php

2. Under the Windows Binaries section, choose the file: PHP 4.3.10 zip package size 7,405Kb dated 15 Dec 2004.

3. Download the file and save it on your hard disk. Unzip the file and rename the extracted folder to "php". Now move this folder "php" and place it under "C:\Program Files\".

4. Move all the files under "C:\Program Files\php\dlls" and "C:\Program Files\php\sapi" to here: "C:\Program Files\php".

5. Copy the file php.ini-recommended to "C:\WINDOWS" and rename it to php.ini

Read more about Apache, MySQL for Windows

PHP, SEO, And Spiders - Oh My!

Dynamic database-driven sites have become very popular, and relatively easy to set up and administer, through the use of Content Management Systems (CMS) and PHP server-side scripting. It's also possible to create a fancy-looking site with little actual content, or automatically generated code that can harm your SEO, such as multiple URLs that display identical content. 

Search engines are constantly evolving and adapting in response to changes in the way information is presented on the web. Strategies that were once necessary to ensure inclusion of PHP pages are no longer required. 

It was once helpful to generate a static HTML version of a PHP page so that all the "includes" could be indexed. Now search spiders "see" all the content on a PHP page, the same way it is viewed in a browser. 

It used to be prudent to avoid dynamic URLs containing "? & =" - now, the search engines list URLs with the dynamic variables. However, it is best to compose them with no more than three variables. Some variable-laden URLs may be listed, but without any accompanying content/description, in the search results... Stay tuned for further developments as the search engines refine their methods. 

With many hosts running the popular Apache server, developers are expanding the use of PHP by modifying the .htaccess file to allow PHP code processing within HTML documents, and enabling shorter URLs with fewer variables by configuring httpd.conf. Your web hosting provider's support team should be able to tell you if these features are available for your site. 

Implementing a common-sense approach to SEO for your PHP site requires cooperation and coordination among the developer, webmaster, and web host. Beware of "SEO Experts" with "secret methods" and "guaranteed results" - gimmicks that kludge the search spider today might hurt your ranking tomorrow. 

A descriptive and catchy page title is one of the key elements of SEO - whether or not your site uses PHP - since it becomes the linked title of your search engine listing. Use the name of your site in the title to encourage branding, along with a brief capsule about the specific page. Remember that the title displays at the top of the browser window and in the menu bar, so keep it brief, less than 160 characters. Avoid using identical titles on multiple pages (this can easily happen with dynamically generated titles) because they may not be listed individually, and if they are listed separately, it's confusing. Meta tags for description and keywords have become less crucial to SEO - but that doesn't mean you should forget about them. 

The basic principles of SEO that apply to static HTML sites also apply to dynamic PHP sites: 

● Provide engaging and valuable content presented in an attractive design. 

● Code should be error-free and standards-compliant. 

● Use keywords appropriate to your subject matter - don't be tempted to use "tricks" that might end up hurting your search engine listing.

Read full Article

ASP vs. PHP

When building web sites, ASP and PHP are very popular languages. Here’s my opinion on whether ASP or PHP is best.

ASP v. PHP

Both ASP and PHP are languages used to build Dynamic Web sites that can interact with Databases and exchange information. ASP (Active Server Pages) is from Microsoft and is used with IIS (Internet Information Server) that runs on Microsoft Servers. PHP (Personal Home Pages) is from Rasmus Lerdorf, who originally designed this parsing language which was later modified by different people. It runs on Unix and Linux servers and it also has an NT server version. 

There are a lot of differences between ASP and PHP. 

Cost

To run ASP programs one needs IIS installed on a Windows platform server, which is not free. PHP programs run on Linux, which is free. Even the connectivity of the database is expensive in the case of ASP as MS-SQL is a product of Microsoft that needs to be purchased. PHP generally uses MySQL, which is freely available. 

Speed

If we compare the speed of ASP and PHP then PHP has an upper hand. PHP code runs faster than ASP. ASP is built on COM based architecture, which is an overhead for the server whereas PHP code runs in its own memory space. 

Platform Compatibility

PHP programs can run on various platforms like Linux, Unix, Windows and Solaris whereas ASP is mainly associated with Windows platforms. However, ASP can run on a Linux platform with ASP-Apache installed on the server. 

Additional Costs

Many of the tools used in PHP are free of cost and since PHP is open source a lot of code can be found in open source forums. PHP has inbuilt features like ftp, email from a web page or even encryption mechanisms but in ASP such features are not built in and some additional components are required. Therefore an additional cost is incurred for such components. 

Base Language

PHP is based on C++ language and the syntax used in PHP is quite similar to C/C++. C/C++ is still considered the best programming language by many programmers and people who love this language would surely feel more comfortable with the syntax of PHP. ASP on the other hand has a more Visual Basic kind of syntax that again is closely related to only Microsoft products. So, it depends on a person-to-person which language he or she is comfortable.

Read more on ASP.NET Vs PHP

What is PHP Hosting?

PHP hosting is a server-side scripting environment that is used to create dynamic web pages. PHP is an abbreviation for Hypertext Preprocessor, an open source language widely used by programmers and web developers. The fact that it is open source gives it a lot of advantages over proprietary programming languages. Due to this reason, PHP has been the most famous server-side scripting language and almost all hosting providers offer PHP hosting services nowadays. 

PHP is an object oriented language. The way PHP hosting works is that the web server would filter a request document using PHP and generates the output from PHP to the web browser. These documents are usually in HTML format with PHP tags inside. The tags can be run on both Windows and UNIX servers. In terms of output text, PHP is capable to generate any format such as XHTML and XML. 

With PHP, web developers would be able to perform any CGI tasks, such as generate dynamic contents or send and receive cookies. PHP is also capable of outputting PDF files, Flash videos and images on the fly at high speed. This is possible due to its ability to save the required files in its file system and forming a server-side cache. 

There are a host of advantages of using a PHP hosting. For beginners, it is a relatively easy language to learn and work on. While for seasoned developers, there are a lot of advanced applications and features that comes with PHP hosting. In terms of cost, it is one of the cheapest hosting solutions as it is an open-source technology. There are also programming tools that come free with PHP hosting, contributed by programmers worldwide. 

PHP is especially strong in relational databases, which are used for dynamic contents, product catalogs and e-commerce applications. The relational database application that comes with PHP is called MySQL, which is also open-source. It is known for its high reliability, precision and flexibility. These advantages have made it the more preferred alternative compared to proprietary databases systems.

Read more on PHP Hosting

Basics of PHP

Practical Uses of PHP 

It almost goes without saying that you will want your business website to be compelling, interactive, and secure. All of these characteristics will make your website more effective at bringing in and keeping customers. But how to go about it in a way that is stable, cost-effective, and easy to manage? One popular solution is to use the server-side scripting language PHP to help you solve those problems.

What is PHP?

Created in 1995, PHP originally stood for "Personal Home Page", however it is now generally understood to mean "PHP: Hypertext Preprocessor". It was originally designed to create dynamic or more interactive web pages. It is a widely-used, open-source, general-purpose scripting language. PHP is a "high-level" language, meaning that it's generally more human-friendly (and easier to learn) than other programming languages such as C, ASP or ASP.net.

PHP was originally designed for use in Web site development, but rapidly grew to become a much more robust language. PHP's primary use is as an "embedded" scripting language, which means that the actual PHP code is embedded in HTML code. When used in this way, PHP enables your web server to process web pages before they're displayed in the user's web browser.
Benefits of PHP 

PHP is popular because it can be embedded directly into HTML coding. 

PHP can be used on all major operating systems and is supported on most web servers. 

PHP's main focus is development for the web, so it has a quick development time and can solve scenarios much quicker than some of the other web design languages. 

The latest version of PHP is a very stable and mature language used for web programming much like Java and Microsoft C#. 

It is open source so it is free! 

Database: It is very easy to write simple scripts which allow your Web site to interact with a database. 

Cross-Platform: Both the PHP engine and the PHP code can be used on almost any platform, making it extremely versatile. 

Development Tools: You only need a text editor to work on PHP; you do not need any development environment or compilers. 

What can you do with PHP?

PHP generally runs on a web server, taking PHP code as its input and creating Web pages as output, however you can also use it for command-line scripting and client-side GUI applications. PHP is an extremely versatile language which enables you to create high-end, stable Web sites with plenty of bells and whistles. Here are just a few of the things you can do with PHP:

Make HTML Web Forms 

Store Information in Databases 

Remember Web site visitors (cookies and sessions) 

Work with Arrays 

Work with Files (File Management and downloads) 

Parsing and Generating XML (also useful for large quantities of products on e-commerce) 

Check which browser your visitor is using 

How does PHP Work?

As its name ("PHP: Hypertext Preprocessor") suggests, PHP derives its power by "preprocessing" hypertext on the server side. This generally means that when the PHP script (saved as a .php file) runs on your web server, it performs the programmed actions, and returns HTML code that will then be sent back to your customer's web browser. The PHP script itself is not included in the HTML that is sent to the browser, so the PHP code is invisible and secure to the user.

For example, let's consider the following simple PHP statement. (This example is merely to show the basic syntax of PHP in action. Any detailed discussion of PHP code is beyond the scope of this article.)



In this statement, is the closing tag, and echo is a PHP instruction that tells PHP to output the text that follows it as plain HTML code. The PHP software processes the PHP statement and outputs the following:

Hello World 

This is a regular HTML statement that is delivered to the user’s browser. The PHP statement itself is not delivered to the browser, so the user never sees any PHP statements.

Using PHP to Improve Your Website.

PHP has many capabilities features designed specifically for use in Web sites, including the following:

1. Securing Your Website.

PHP can be used to secure your website (or certain areas of your website) so that your customer must enter a valid username and password. This can be used to reward preferred customers and to build an exclusive "membership" component of your business.

2. Working with Web Forms.

PHP can display an HTML form and process the information that the user types in. This can be an excellent way to learn more about your customers by asking them to provide profile information, and to collect information about their specific interests.

3. Communicate with Your Databases.

PHP is particularly adept at interacting with your databases, and storing information from the user or retrieving information that is displayed to the user. PHP handles connecting to the database and communicating with it, so it's not necessary to know all of the technical details for connecting to or exchanging messages with the database. You tell PHP the name of the database and where it is, and PHP handles the details. All major databases are currently supported by PHP.

Read more on Basics of PHP