PHP中“使用未定义常量”通知的含义是什么? [重复]

Notice: Use of undefined constant username - assumed 'username' in
/home/content/04/7195304/html/header.php on line 54

I get this when writing things like $_COOKIE[username] or $_POST[username].

Edit

So I've been playing around with the code, putting quotes in my POST, COOKIE, and GET's.. I still get the same thing!

</div>

It means you likely forgot a $ in front of your variable name.

Edit You need to encapsulate your call in qoutes. I.e.

$_COOKIE["username"]

or

$_POST["username"]

It probably means you forgot to put a $ in front of your username variable, so it's treating it like a constant instead of a variable.

You should post the code from that line for better help.

You might as well try $_COOKIE['username'] or $_POST['username'], to access the associative arrays with a string.

Sorry, overlooked comment with same advice.