Create dynamic sites with PHP & MySQL - Your first script
(Page 6 of 16 )
Following tradition, we will begin coding with a "hello world" example. Fire up your text editor and type the following code:
<HTML> <?php echo "Hello World"; ?> </HTML> |
Save the file as first.php and view it in the browser (remember to set the permission to chmod 775 first). The page shows "Hello World". View the HTML source of this page through your browser. You will only see the text Hello World. This happened because PHP processed the code, and the code told PHP to output the string "Hello World". Notice the <?php and ?>. These are delimiters and enclose a block of PHP code. <?php tells PHP to process all the lines following this as PHP code and ?> tells PHP to stop processing. All lines beyond this scope are passed as HTML to the browser.
Next: Your first database >>
More Database Articles Articles
More By Codewalkers
|
| · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | · | | | | |
|