i am install xampp recently
i will write a function in php
$value=$_GET['value'];
but it shows an error "Undefined index"
i will also try $_REQUEST function
plse help me
i am install xampp recently
i will write a function in php
$value=$_GET['value'];
but it shows an error "Undefined index"
i will also try $_REQUEST function
plse help me
It shows undefined index because you did not set the GET parameter value
. If you will not always be setting it, do something like this:
$value = (isset($_GET['value'])) ? $_GET['value'] : 'default_value';
...or...
if (isset($_GET['value'])) {
$value = $_GET['value'];
}
Essentially, you need to verify that a variable is set before you try and use it or it will generate warnings.