Getting Value from other PHP page
I have this problem on how to pass or get value or variable from one PHP page to the other. Is there any easy way or functions on how to do this? Please Help.
I have this problem on how to pass or get value or variable from one PHP page to the other. Is there any easy way or functions on how to do this? Please Help.
Dear friend,
$_POST: It is used to get value from another PHP page which uses method as post.
When this method is used the data is not visible to others.
$_GET: It is used to get value from another PHP page which uses method as get.
When this method is used the data is visible to others in URL.
$_REQUEST: Using this method you can get value which uses method as get, post & cookie.
This method is somewhat not safe to use.
Examples
$_POST
<?PHP
//$_POST[‘input name here’];
$phoneno=$_POST[‘phone’];
echo $phoneno;
?>
Â
$_GET
<?PHP
//$_GET[URL variable name’];
$phoneno=$_GET[‘phone’];
echo $phoneno;
?>
Â
$_REQUEST
<?PHP
//$_ REQUEST [‘input name here’ | URL variable name’ | ’cookie’];
$phoneno=$_ REQUEST [‘phone’];
echo $phoneno;
?>