Software & Finance





PHP Programming - Syntax





 

If you copy a .html file into .php, it would work fine with out any major issues.

 

The advantage of PHP is you can connect with database and run time build the html code. You can also validate html form post iniformation including login session using php. PHP is widely used in web development applications today.

 

You have too many things of PHP, then usually the .php file would start with "<?php" and ends with "?>". Within php file, you want to emit html tags, echo function is used. Alternatively you can have everything else in html, and you can these php tags on the .php page whenever required.

 


The sample code for portal_login.php is given below:

    
User Name: Password:

The code for "portal_welcome.php" is given below:

// multiple ';
        ?>
        
You password is: .

The above code can also be written as,

        ';
           echo '
'; echo "You password is: "; echo $_POST["password"]; ?>