PHP Error, Notice: Undefined index: q

By pbaloyi ·
Am new to php and am using wamp as my server. I have the following code;

If ($_GET['q'] == 'home')
$header="Welcome to the Homepage";
$content="Welcome to the Homepage of a lifetime";

and html code as follows,
<a href="index.php?q=home">Home</a> |

When i open the webpage for the first time, an error appears:
Notice: Undefined index: q in C:\wamp\www\prizeinfo\index.php on line 3

but if i click the link 'home' the error disappears. Please i need help on this.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums