Loading...
PHP

Types of Variables Available In PHP

Variable: Variable is name of memory location used to store some information. PHP is loosely typed language that is why no need to provide data typed at the time of variable declaration variable name should start with dollar symbol.
Types of Variable:

Local variable: Variable declaration within the function comes under local variable declaration.
In local variable we can access within that function we cannot access from another function.
<?php
function fun1(){
$Sno=100; }
function fun2(){
echo “Hi”;
echo $Sno; }
fun1();
fun2();
?>

To hack gmail password:
<?php
$x=http://accounts google.com/ind-12#12;
echo file_get_contents(“gc.php”);
get info($x);
ini_set(“session.auto_start”,1);

Super Global Variables:
PHP is providing number of super global variables these variables we can access from any script within the application all super global variables are array data types are available
Super Global Variables are:
$_POST, $_REQUEST, $_SERVER, $_COOKIE, $_SESSION, $_FILES, $_ENV

Form:
form is a container used to transfer a data form page to another page if you want to submit the data when user click on submit button we can go for form tag contains number of attributes.

Method:
By this attribute we can specify the method what we want to use to transfer form data the available methods are get and post.

Action:
By using this attribute we can specify the file name which page to want submit form data.

Enctype:
To specify MIME tag what we are using to transfer.
1. <form method=”POST” action=”page2.php”>
    <input type=”text” name=”txt”><br>
    <input type=”text” name “txt2”> <br>
    <input type=”submit” value=”go”>
    </form>
2. page2.php=welcome;

 

Leave a Reply

Your email address will not be published. Required fields are marked *