PHP Variable



Click to Enlarge
Here I am Describing Basic of Variable.

There are many type of variable used in PHP.

Following are some:

  • Variable from GET Method 
  • Variable from POST Method 
  • Variable Used in a PHP program itself
  • Variable from SESSION  
  • Variable from COOKIES


Variable Type

Description

GET Method Variable
Variable Used as: Array

Using Technique: As Following:
  • By referencing in URL i.e. filname.php?variable1=value1&variable2=value2
  • By Sending by FORM method will be GET i.e. By HTML Input fields like text, password, select etc.

Validity/ Scope: Till they reference in URl or sent by Forms

Calling as: Called as $_GET['variable1'] and $_GET['variable2']
POST Method Variable
Variable Used as: Array

Using Technique: As Following:
  • By Sending by FORM method will be POST i.e. By HTML Input fields like text, password, select etc.

Validity/ Scope: Till sent by Forms and the File is running

Calling as: Called as $_POST['variable1'] and $_POST['variable2']

To be continue ............

Comments

Popular posts from this blog

Page Unload Show Notification to user

Function Oriented File Upload PHP

Upload File Using PHP - Example For Image