I think we all do appreciate what you're trying to teach us here, but most of us do already know about what you're saying.

Beginners to PHP will definitely benefit from what you're teaching though. I'll help you out by giving a couple of pointers/corrections in regards to the code you posted.
FireElement wrote:null is a string NULL is empty.
To make a small correction so you know in the future: "null" (with quotes) is a string, and null (without quotes) is empty. The quotation marks are what dictates whether it's a string or not, so if you want to make sure something isn't null (empty), you would want to do...
I'm not 100% sure, but I don't think capitalization matters. If I'm wrong and it does, make sure you have NULL instead of null in my example.
And to give you a little heads-up regarding your first post, when dealing with select boxes, you should check the value against specific values rather than just against null. Because the users can actually create their own form if they're clever (it's easy to do) and put in their own box selections... to put this in practical terms, if you only want your user to select from Apple, Orange, and Banana in your listbox, you better make sure your PHP code is checking to see that the user didn't somehow select Grape or Pear!
The way that a clever user/hacker would choose Grape or Pear in that case would be by writing his own HTML form, and then having that form submit to your PHP script. It's a very simple process, as you can see.
So when I have selection boxes in a form (be it radio buttons, checkboxes, listboxes, etc.), I usually do something like this:
Code: Select all
$fruit = "Apple"; // set a default value first-- if no real option is picked, the variable will remain at this "Apple" default value
if ($_GET['fruit'] == "Apple")
$fruit = "Apple"; // a little redundant since it's already at Apple, but I put this in here as an example
if ($_GET['fruit'] == "Orange")
$fruit = "Orange";
if ($_GET['fruit'] == "Banana")
$fruit = "Banana";
echo "You chose $fruit";
That way, if the user chose something that didn't really exist in your form, like "Grape" or "Pear" (by using their own form), it would stay as the default "Apple". This is much safer than just going "$fruit = $_GET['fruit'];"