
A quick PHP snippet for validating that a URL query parameter exists and is not empty before using it.
http://www.example.com/Test.php will return: “missing parameter param1”
http://www.example.com/Test.php?param1= will return: “param1 is empty!”
http://www.example.com/Test.php?param1=1 will pass the validation
now you know you have a non empty URL parameter, what’s left is to validate it’s value.
