giving error Notice: Undefined offset: 2
for this line: $seg2 = $IN->SEGS[2];
function displaySurvey() {
global $IN;
$seg2 = $IN->SEGS[2];
if($seg2) {
switch($seg2) {
case 1601:
$url = "444053F83FBF9C31";
break;
case 1802:
$url = "D66C9BD62F40C3CF";
break;
case 2107:
$url = "7023023BC27C7F99";
break;
default;
$url = NULL;
break;
}
}
}works fine when the URL is domain.com/segment_1/segment_2
but if the URL is domain.com/segment_1/ - it gives me that error.
it is expecting a value to be stored within $seg2, but I do not know how to “shut it up”.
Any help is appreciated.
EE v1.6.9 20100415