Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Monday, September 23, 2013

PHP-1 : My first PHP

Refer this introduction , before doing any PHP program.
PHP Introduction - And some useful points in Programming
  • Open Dreamweaver to write php code , with in the body tag .That is , 
<body>
.......................} php code 
</body> .
and save it (as .php) under the www directory of wamp server.
  • Then click wamp-->localhost to view it in the browser.
=================================================================

<!DOCTYPE html>
<html>
<body>

<h1>My First PHP Page</h1>

<?php
echo "Hello PHP!";
?>

</body>
</html>

Output : 



Note :

  • "echo" is used to output the text "Hello World!" on a web page (echo is not case-sensitive, that is ,we can write ECHO,EcHo , echo...etc)In PHP there is two basic ways to get output: , ECHO and PRINT . echo can output one or more strings , and can be used with or without parantheses: echo or echo() and print can only output one string, and returns always 1 , also can be used with or without parantheses: print or print() .
  • Always add the <!DOCTYPE> declaration to your HTML documents, so that the browser knows what type of document to expect.That is , when you use a DOCTYPE declarations in your web pages (and many HTML editors likeDreamweaver add them in automatically), you are telling the web browser what version of (X)HTML your web page should be displayed in.
  • A string is a sequence of characters, like "Hello World !".
    A string can be any text inside quotes. You can use single or double quotes:
    That is , we can write "Hello World !" & 'Hello World !'
    ==================================================
Back to HOME & PHP 

No comments: