Possible Duplicate:
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
Here is my "index.php" page:
<?php
if($_GET['p']==4)
$p='dodaj.php';
if($_GET['p']==3)
$p='dodaj_wplate.php';
else if($_GET['p']==2)
$p='dodaj_u.php';
else
$p='index.php';
?>
Wybierz coś!.<br>
<a href="index.php?p=4">Dodaj osobę</a><br>
<a href="index.php?p=3">Dodaj wpłatę</a><br>
<a href="index.php?p=2">lDodaj ubezpieczenie</a><br>
<?
include $p;
?>
And I am getting error:
Notice: Undefined index: p in C:\xampp\htdocs\proj\index.php on line 3
Notice: Undefined index: p in C:\xampp\htdocs\proj\index.php on line 5
Notice: Undefined index: p in C:\xampp\htdocs\proj\index.php on line 7
Wybierz co!.
Dodaj osobę
Dodaj wpłatę
lDodaj ubezpieczenie
How can I define my "p"? Because I can see there is problem.
Also, not related to question, can you give me any link to layout tutorial related to php?