Hi,
I understand that newer versions of PHP have recently tightened up the way variables are declared and handled.
So, if I simply say:
print $firstname;
Then I'll get an error message which says (something like):
Notice: Undefined variable: firstname in C:\wamp\www\test\index.php on line 2
Also, to make the nightmare worse, if I say
$firstname=$_GET['firstname'];
...then I get a wonderful new error which is as follows:
Notice: Undefined index: firstname in C:\wamp\www\test\index.php on line 4
My question, of course, is "How do I sort this out?". But before telling me to initialise the variables or read the manual (I've already looked) please let me add one more detail...
I understand that I can initialise the variables by saying things like...
$firstname="";
or even...
$_GET['firstname]="";
This simple fix does indeed make the error messages disappear. BUT WAIT! Let's not crack open the campaign yet!
If I declare $_GET['firstname]' to NULL (nothing or whatever) then I have totally destroyed the original purpose of the GET variable - which is to read variables from the URL. How can I ever read variables from the URL if at the top of all the scripts I'm declaring those variables as being equal to nothing.
I'm on my knees begging for help.