$ _POST, $ _GET or $_REQUEST are the PHP functions that are used to get variables from a user-filled form or user requested pages. While using these functions, a user may encounter undefined index error.
Undefined index is a minor error and this error can be avoided with the help of PHP isset ().
You can hide this notice with the help of the error_reporting function. Simply make error_reoprting(0) to hide all notifications. Add the following code to the first line of your php code.
<?php error_reoprting(0); ?>
<?php $name = $_POST['name']; /* This may show Undefined index error. */ ?>
<?php
if (isset($_POST['name'])) {
$name = $_POST['name'];
}
?>
<?php
if (isset($_GET['value'])) {
$var = $_GET['value'];
}
//or
if (isset($_REQUEST['value'])) {
$var = $_REQUEST['value'];
}
?>