Question Locked

PHP Error, Notice: Undefined index: q

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

and html code as follows,
Home |

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.

Thanks

3 replies

by tony hopkinson

as in http:\\localhost\index.php?q=home
That is isn't going to happen on first time in, so you need to test for q existing as well in your logic
if(isset($_GET['q']), i think but my php is a bit rusty.

This discussion is closed to new replies.