you've got error reporting set pretty high to get that. The correct way to reference an array element in this case is $_GET["id"], if you do $_GET[id] you are telling PHP to look for a constant called id. If it doesn't find one then it assumes you meant "id" onstead of id and proceeds accordingly. Thats why you can get away with not using the quote marks (as long as there's no white space in the string).
On a live site (and, I'd have thought, most default set-ups) you'd expect error reporting to be set all off and you'd never see the message. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] ----- Original Message ----- From: fragmonster <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 17, 2002 10:49 AM Subject: [PHP] "Use of undefined constant" error > Hello, > I've got a strange pb. Here's my code > > <? > if(isset($_GET[id])){ > do something... > else > do something else > } > ?> > > When I call myfile.php or myfile.php?id=1 I've got an error message > "Notice: Use of undefined constant id - assumed 'id' in ..." > > Please help > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php