$func=$_GET['func']?$_GET['func']:$_POST['func'];
While calling this function following error is showing
Notice: Undefined index: func in C:\wamp\www\Web Engg final project\phplogin.php on line 2
this error us showing ?
$func=$_GET['func']?$_GET['func']:$_POST['func'];
While calling this function following error is showing
Notice: Undefined index: func in C:\wamp\www\Web Engg final project\phplogin.php on line 2
this error us showing ?
It seems, you are not getting $_GET['func']
also $_POST['func']
.
You are assuming that if $_GET['func']
is not set, there will be $_POST['func']
.
Instead of it, add a logic:
1) Create a new variable $func
, default it to blank.
2) If isset($_GET['func']), assign to it.
3) If isset($_POST['func']), assign to it.
Code:
$func = '';
if (isset($_GET['func'])) {
$func = $_GET['func'];
}
else if (isset($_POST['func'])) {
$func = $_POST['func'];
}