Narrow It Down ...
 Top 20 Virtual Hosts
 Top 10 Dedicated
 User Reviews
 The Help Desk !
 Community Starts...
 In the Chat Room
 
 Search for Hosting..
 Under $10 Per Month
 With ASP Support
 With PHP3/4 Support
 With Ecommerce Tools
 With WAP Support
 With JSP Support
 Dedicated Servers
control your domain


 

PHP Programming Basics - iHostcafe.com
We get several requests daily about database connectivity with PHP3. This tutorial will give you a better idea of what PHP is about, how it works and an easy script to connect to a Mysql Database.
What is PHP and how do I use it? Courtesy PHP.net
PHP is a tool that lets you create dynamic web pages. PHP-enabled web pages are treated just like regular HTML pages and you can create and edit them the same way you normally create regular HTML pages.

What do I need?

In this tutorial we assume that your server has support for PHP activated and that all files ending in .php3 are handled by PHP. On most servers this is the default extension for PHP files, but ask your server administrator to be sure. If your server supports PHP then you don't need to do anything. Just create your .php3 files and put them in your web directory and the server will magically parse them for you. There is no need to compile anything nor do you need to install any extra tools. Think of these PHP-enabled files as simple HTML files with a whole new family of magical tags that let you do all sorts of things.

Your first PHP-enabled page

Create a file named hello.php3 and in it put the following lines:
<html><head><title>PHP Test</title></head>
<body>
<?php echo "Hello World<P>"?>
</body></html>
The colours you see are just a visual aid to make it easier to see the PHP tags and the different parts of a PHP expression. Note also that this is not like a CGI script. The file does not need to be executable or special in any way. Think of it as a normal HTML file which happens to have a set of special tags available to you that do a lot of interesting things.

This program is extremely simple and you really didn't need to use PHP to create a page like this. All it does is display: Hello World

If you tried this example and it didn't output anything, chances are that the server you are on does not have PHP enabled. Ask your administrator to enable it for you.

The point of the example is to show the special PHP tag format. In this example we used <?php to indicate the start of a PHP tag. Then we put the PHP statement and left PHP mode by adding the closing tag, ?>. You may jump in and out of PHP mode in an HTML file like this all you want.

NEXTPAGE
 Tutorials On..
 PHP and Mysql
 Ecommerce Starter
 Catch Up On..
 Webhosting News
 Ecommerce News
 General Internet
 I Can Help By..
 Adding a Review
 Submitting a Tutorial
 Writing an Article
 
Search By Price
 
 
 
 Become A Partner
 Co-Branding Programs
 Datasharing Programs
 Current Partners
 Home