ITekBlog The IT resource kit
code games infra news reviews tags RaveMaker RaveMaker ETCS ETCS

Validate Non-Empty URL Parameters in PHP

2012-03-13 ETCS
php validate
Validate Non-Empty URL Parameters in PHP

PHP-logo url parameter

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.

© 2026 ITekBlog