If $_GET['p'] is not set, you can't check $_GET['p'] != 'index' and all the others. You'll have to check if it's set first:
<?php if(
! isset( $_GET['p'] ) ||
($_GET['p'] != 'index' &&
$_GET['p'] != 'reg' &&
$_GET['p'] != 'login' &&
$_GET['p'] != 'ad')
): ?>
A better solution would be to put all those values in an array, and check if $_GET['p'] is in the array:
<?php if(
! isset( $_GET['p'] ) ||
! in_array(
$_GET['p'],
array('index', 'reg', 'login', 'ad')
)
): ?>
EDIT:
Now that you provided some more info, here's what you should do:
if ( ! isset($_GET['p']) )
{
// We're at the index page, so don't display anything
}
else
{
if ( in_array( $_GET['p'], array('index', 'reg', 'login', 'ad') ) )
{
// Display your content window
}
else
{
// $_GET['p'] is not a valid value, display error
}
}
!isset($_GET['p']), put it first in the list BEFORE checking equality.!isset($_GET['p'])to evaluate toTRUEwhen the get request is like this?or when it is?p=?