OCC HOSTING
OCC HOSTING
 
OCC HOSTING
 
OCC HOSTING Unix Package
OCC HOSTING Windows Packages
OCC HOSTING Cold Fusion Packages
OCC HOSTING Email Hosting Packages
OCC HOSTING Dedicated Servers
OCC HOSTING Co Location Packages
 
OCC HOSTING
 
OCC HOSTING Domain Registration
OCC HOSTING Site Studio - Site Builder
OCC HOSTING Search Engine Submission
OCC HOSTING 3rd Party Billing Solutions
OCC HOSTING Affiliate Program
OCC HOSTING Reseller Programs
OCC HOSTING Instant SSL Certificates
OCC HOSTING Submit Support Ticket
OCC HOSTING Access Knowledge Base
 
OCC HOSTING
 
OCC HOSTING Network Status
OCC HOSTING About Our Servers
OCC HOSTING About OccHosting
OCC HOSTING Our DNS Settings
OCC HOSTING
OCC HOSTING
 
How to Write PHP

PHP is a server-side scripting language for creating dynamic Web pages. You create pages with PHP and HTML. When a visitor opens the page, the server processes the PHP commands and then sends the results to the visitor's browser, just as with ASP or ColdFusion. Unlike ASP or ColdFusion, however , PHP is Open Source and cross-platform. PHP runs on windows NT and all Unix servers, and it can be built as an Apache module and as a binary that can run as a CGI. When built as an Apache module, as on OCChosting, PHP is especially lightweight and speedy. Without any process creation overhead, it can return results quickly, but it doesn't require the tuning of mod_perl to keep your server's memory image small.

In addition to manipulating the content of your pages, PHP can also send HTTP headers. You can set cookies, manage authentication, and redirect users. It offers integration with various external libraries that let you do everything from generating PDF documents to parsing XML.

PHP goes right into your Web pages (anywhere in your WWW directory except the CGI-BIN), so there's no need for a special development environment or IDE.

You start a block of PHP code with <?php and end it with ?>. (You can also configure PHP to use ASP-style <% %> tags or even <SCRIPT LANGUAGE="php"></SCRIPT>.) The PHP engine processes everything between those tags.

PHP's language syntax is similar to C's and Perl's. You don't have to declare variables before you use them, and it's easy to create arrays and hashes (associative arrays). PHP even has some rudimentary object-oriented features, providing a helpful way to organize and encapsulate your code.

PHP files should have an identifying extension so the server will know to execute the code - .phtml or .php


Writing Dynamic Web Pages with PHP

Let's start with the simple Hello World example. Here's the code:

<html>
<head>
<title>Hello World</title>
</head>
<body>
<?php
echo "Hello World";
?>
</body>
</html>


This is a somewhat silly example, but it can be used to teach you a few things anyway.

Most of the code is just plain HTML. Only the part between <?php and ?> is PHP-code. You use either <?php or just <? to start the code and ?> to stop it again. The parser works within these two tags. Between the <?php and ?> you put a number of statements, which all must be ended by a ;.

Between the two tags there is one statement, echo "Hello World";. This statement just prints the string "Hello World" into the webpage, which is then sent to the browser. After the parser has processed the page, the final output that is sent to the browser looks this way:

<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World
</body>
</html>

As you can see, there's no trace of the PHP-code left in the final output. You should think of a PHP-script as a normal webpage written in HTML, since most of the page is still just plain-old HTML. But between the start- and end-tags (<?php or < and ?>) the PHP-parsed spices the page up with possibly dynamic content.

Check out our Sample Scripts and Sources page for links to PHP tutorials, sites and sample PHP code.

 

 
OCC HOSTING
 
  OCC HOSTING  
 
 
OCC HOSTING VSG Design
OCC HOSTING OCC Merchant
OCC HOSTING OCC Adult
OCC HOSTING Help
 
 
 
  OCC HOSTING  
 

For more information, please call:

Voice
954-977-2797
Fax
1-954-323-8871
Toll Free
1-877-583-3275
or
email us