5. Loops in PHP

Loops execute a block of code a specified number of times, or while a specified condition is true.

Loops - While Statement :   
  • The while loop executes a block of code while a condition is true.
  • while (condition)
    {
    code to be executed;
    }
[ Code ] : 
http://pastebin.com/EX7L8f4J

For More loops Click On READ MORE

6. Functions in PHP

Functions (Basic) :
  • To keep the script from being executed when the page loads, you can put it into a function.
  • A function will be executed by a call to the function. 
  • You may call a function from anywhere within a page. 
  • Syntax:
    function functionName()
    {
    code to be executed;
    }

[ Code ] :
http://pastebin.com/yNii9Gya

Functions (Advanced) :
  • We can also pass parameters to functions during both the declaration and calling time.
  • function functionName($param1,$param2); //during function call.
  • function functionName($param1,$param2) 
  • {
    code to be executed
    }     
[ Code ] : 
http://pastebin.com/hCeJ4Kmk

7. PHP Special Variables

GET Variable :
  • The built-in $_GET function is used to collect values from a form sent with method="get".
  • Information sent from a form with the GET method is visible to everyone (it will be displayed in the browser's address bar)  
  • It has limits on the amount of information to send.
[ Code ] :
http://pastebin.com/6kfYqfvq

POST Variable :
  • The built-in $_POST function is used to collect values from a form sent with method="post".
  • Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.  
[ Code ] : 
http://pastebin.com/FGazFkEY

8. PHP and HTML

 Embedding PHP
  • We can embed our PHP code anywhere in the webpage, by enclosing our script within the <?php...... //SCRIPT.......?>  
[ Code ] :
http://pastebin.com/m2crcKG3

Common Way to Display HTML
  • We can also use the HTML Code within the PHP Script. Almost each of the HTML Tags can be used within a PHP Script.

[ Code ] :
http://pastebin.com/JSXznzQ7

MYSQL Tutorials: Level 2

MySQL is a Relational Database Management System (RDBMS) that runs as a server providing multiuser access to a number of databases. A third party open source software "phpMyAdmin" will be used as a web-based front end for managing MySQL databases easily and efficiently. It is widely installed by Web hosts worldwide, since it is developed in PHP and is included in the convenient LAMP stack, MAMP, and WAMP software bundle installers.