|
PHP - Easy Dynamic Websites PHP: Easy Dynamic Websites.PHP is the most popular scripting language on the web, and the reason for that is how easy it makes it to create dynamic websites quickly. If you're already a programmer, you'll be able to learn the basics of PHP in about five minutes, and if you're not then it probably won't take much longer. Getting Started in PHP. There's a tradition in programming that the first thing you do in any language is say 'Hello World'. Well, here's how you do that in PHP. First of all, create a file in your server's root directory called index.php. Put this text in it: Let's look at this bit by bit. The first line means 'what follows is PHP code'. 'echo' is the PHP command to send text to the web browser, and each line of PHP has to end with a semicolon. Finally, the last line means 'end of the PHP code'. This is a complete HTML document with pieces of embedded PHP. The first PHP section inserts the date into the title, and the second writes the answer to 1 + 1 (that's 2, you know) as the content of the document – the word with a dollar before it is a variable, storing the result of the sum. Where this all becomes extremely useful is that your PHP code can open a connection to a database, read data from it, and then the text into a template, along with other things from the database like the headline, the author's name and the date it was written.
This Article was brought to you by Rob Jean. www.OnlineCashmaker.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - All Articles at http://OnlineCashmaker.com/FREE-Website-Design-Tips/ may be copied and used by you providing they remain intact and include this message. ************************************************************* Rob Jean (ocmUK) is the Owner and Creator of: - OnlineCashmaker.com - EbookMagic.co.uk - eauctionhouse.co.uk - - Hot-Scripts.co.uk - Cheap-Web-Host.co.uk - Please feel free to visit any of my websites.(opens in new window) | ||