The Mystery has been resolved (at least I think I know why):
Upon entering the page I had the following check:
if(!isset($Id))
{
die("Need 'Id' parameter");
} else
{
$Id=addslashes($Id);
}
Later,.. I've added the check for the is_string etc...
As it turned out,... this line
$Id=addslashes($Id);
I believe was the source of all my trouble.
By adding the slashes, I've changed the value from whatever it was to a string like or someother type of variable.
Hence,. I was doing all sorts of actions AFTER the change and of course the outcome was unexpected.
This was a copied line segment from another file and since the Id is always numeric, I've simply removed the else statement and voilla,.. it works like a charm.
Thanks for your suggestions and help.
Thank you Diego, as I was working your suggestion I then noticed the very first input process of the variable. BTW, how I tell if register_global is on? will it show in info_php()?
-Alon.