PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Alrighty, the issue here is not the header at all. You're fine doing the header that way. You are right to ask about the value of $candy. Unless you know that you know that you absolutely have to have register globals on, never turn it on. Now, with register globals off, no variable (except for variables php automatically creates like $_SERVER, or $argv, etc) has a value before it is defined. Therefore, if you want to use a GET or POST for the key "candy", then you need to explicitly capture that user input like you did in your second post.