I have a test.php and i have the below code
<?php
if(isset($_GET['p']) or $_GET['p'] != null) {
echo $_GET['p'];
} else {
echo "Not found";
}
?>
I have listed out below urls then required output are show
Test 1 : http://localhost/example/test.php
output : Notice: Undefined index: p in R:\xampp\htdocs\example\test.php on line 3
Not found
Test 2 : http://localhost/example/test.php?p
output : blank page
Test 3 : http://localhost/example/test.php?p=
output : blank page
Test 4 : http://localhost/example/test.php?p=1
output : 1
I accept that Test 1 and Test 2 are true
But when Test 2 and Test 3 fails out the solution.
1 Answer