RE: [PHP] "Use of undefined constant" error
| From: | Jon Haworth | Date: | Tue, 17 Dec 2002 10:52:15 +0000 |
| Subject: | RE: [PHP] "Use of undefined constant" error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-128529@lists.php.net to get a copy of this message | ||
Hi,
> "Notice: Use of undefined constant id - assumed 'id' in ..."
Try changing this:
> if(isset($_GET[id])){
to this:
if(isset($_GET['id'])) {
^^^^
note quotes
PHP thinks you're trying to use a constant called "id", which you haven't
defined - hence the "undefined constant" error ;-)
Note how the message says "assumed 'id'", which is what you should change it
to - this shouldn't stop your script from running, as the parser can work
out what you meant, but your error reporting is set sufficiently high that
PHP lets you know about it.
Cheers
Jon